Test Setup Failed
Pull Request — master (#215)
by Viruthagiri
12:15
created
geodirectory.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 /**
84 84
  * Define constants
85 85
  */
86
-if(!defined('GEODIRECTORY_PLUGIN_DIR')) define('GEODIRECTORY_PLUGIN_DIR', plugin_dir_path( __FILE__ ));
86
+if (!defined('GEODIRECTORY_PLUGIN_DIR')) define('GEODIRECTORY_PLUGIN_DIR', plugin_dir_path(__FILE__));
87 87
 
88 88
 /*
89 89
  * Declare database table names. All since version 1.0.0
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
      * This tries to disable cache on homepage as it can be very dynamic.
109 109
      */
110 110
     define('DONOTCACHEPAGE', TRUE);
111
-    $_SERVER['DONOTCACHEPAGE']= TRUE;
111
+    $_SERVER['DONOTCACHEPAGE'] = TRUE;
112 112
 }
113 113
 
114 114
 
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 if (!defined('GEODIRECTORY_TEXTDOMAIN')) define('GEODIRECTORY_TEXTDOMAIN', 'geodirectory');
119 119
 
120 120
 // Load geodirectory plugin textdomain.
121
-add_action( 'plugins_loaded', 'geodir_load_textdomain' );
121
+add_action('plugins_loaded', 'geodir_load_textdomain');
122 122
 
123 123
 /*
124 124
  * A function to log GD errors no matter the type given.
@@ -129,18 +129,18 @@  discard block
 block discarded – undo
129 129
  * @param mixed $log The thing that should be logged.
130 130
  * @package GeoDirectory
131 131
  */
132
-function geodir_error_log($log){
132
+function geodir_error_log($log) {
133 133
     /*
134 134
      * A filter to override the WP_DEBUG setting for function geodir_error_log().
135 135
      *
136 136
      * @since 1.5.7
137 137
      */
138
-    $should_log = apply_filters( 'geodir_log_errors', WP_DEBUG);
139
-    if ( true === $should_log ) {
140
-        if ( is_array( $log ) || is_object( $log ) ) {
141
-            error_log( print_r( $log, true ) );
138
+    $should_log = apply_filters('geodir_log_errors', WP_DEBUG);
139
+    if (true === $should_log) {
140
+        if (is_array($log) || is_object($log)) {
141
+            error_log(print_r($log, true));
142 142
         } else {
143
-            error_log( $log );
143
+            error_log($log);
144 144
         }
145 145
     }
146 146
 }
@@ -230,13 +230,13 @@  discard block
 block discarded – undo
230 230
      * @since 1.5.6
231 231
      */
232 232
     global $pagenow;
233
-   if ( 'plugins.php' === $pagenow )
233
+   if ('plugins.php' === $pagenow)
234 234
     {
235 235
         // Better update message
236
-        $file   = basename( __FILE__ );
237
-        $folder = basename( dirname( __FILE__ ) );
236
+        $file   = basename(__FILE__);
237
+        $folder = basename(dirname(__FILE__));
238 238
         $hook = "in_plugin_update_message-{$folder}/{$file}";
239
-        add_action( $hook, 'geodire_admin_upgrade_notice', 20, 2 );
239
+        add_action($hook, 'geodire_admin_upgrade_notice', 20, 2);
240 240
     }
241 241
 
242 242
 }
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
  * @since 1.5.7
250 250
  */
251 251
 function geodir_is_testing_mode() {
252
-    if ( defined( 'GD_TESTING_MODE' ) && GD_TESTING_MODE ) {
252
+    if (defined('GD_TESTING_MODE') && GD_TESTING_MODE) {
253 253
         return true;
254 254
     } else {
255 255
         return false;
Please login to merge, or discard this patch.
geodirectory-functions/general_functions.php 1 patch
Spacing   +231 added lines, -231 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
  */
48 48
 function geodir_plugin_path()
49 49
 {
50
-    if ( defined( 'GD_TESTING_MODE' ) && GD_TESTING_MODE ) {
50
+    if (defined('GD_TESTING_MODE') && GD_TESTING_MODE) {
51 51
         return dirname(dirname(__FILE__));
52 52
     } else {
53 53
         return WP_PLUGIN_DIR . "/" . plugin_basename(dirname(dirname(__FILE__)));
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 
161 161
         $add_listing_link = get_page_link(geodir_add_listing_page_id());
162 162
 
163
-        return esc_url( add_query_arg(array('listing_type' => $post_type), $add_listing_link) );
163
+        return esc_url(add_query_arg(array('listing_type' => $post_type), $add_listing_link));
164 164
     } else
165 165
         return get_bloginfo('url');
166 166
 }
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
 function geodir_is_page($gdpage = '')
253 253
 {
254 254
 
255
-    global $wp_query, $post,$wp;
255
+    global $wp_query, $post, $wp;
256 256
     //if(!is_admin()):
257 257
 
258 258
     switch ($gdpage):
@@ -277,14 +277,14 @@  discard block
 block discarded – undo
277 277
             break;
278 278
         case 'detail':
279 279
             $post_type = get_query_var('post_type');
280
-            if(is_array($post_type)){$post_type = reset($post_type);}
280
+            if (is_array($post_type)) {$post_type = reset($post_type); }
281 281
             if (is_single() && in_array($post_type, geodir_get_posttypes()))
282 282
                 return true;
283 283
             break;
284 284
         case 'pt':
285 285
             $post_type = get_query_var('post_type');
286
-            if(is_array($post_type)){$post_type = reset($post_type);}
287
-            if (is_post_type_archive() && in_array($post_type , geodir_get_posttypes()) && !is_tax())
286
+            if (is_array($post_type)) {$post_type = reset($post_type); }
287
+            if (is_post_type_archive() && in_array($post_type, geodir_get_posttypes()) && !is_tax())
288 288
                 return true;
289 289
 
290 290
             break;
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
                 return true;
296 296
             }
297 297
             $post_type = get_query_var('post_type');
298
-            if(is_array($post_type)){$post_type = reset($post_type);}
298
+            if (is_array($post_type)) {$post_type = reset($post_type); }
299 299
             if (is_post_type_archive() && in_array($post_type, geodir_get_posttypes()))
300 300
                 return true;
301 301
 
@@ -314,8 +314,8 @@  discard block
 block discarded – undo
314 314
             if (is_author() && isset($_REQUEST['geodir_dashbord']))
315 315
                 return true;
316 316
 			
317
-			if (function_exists('bp_loggedin_user_id') && function_exists('bp_displayed_user_id') && $my_id = (int)bp_loggedin_user_id()) {
318
-				if (((bool)bp_is_current_component('listings') || (bool)bp_is_current_component('favorites')) && $my_id > 0 && $my_id == (int)bp_displayed_user_id()) {
317
+			if (function_exists('bp_loggedin_user_id') && function_exists('bp_displayed_user_id') && $my_id = (int) bp_loggedin_user_id()) {
318
+				if (((bool) bp_is_current_component('listings') || (bool) bp_is_current_component('favorites')) && $my_id > 0 && $my_id == (int) bp_displayed_user_id()) {
319 319
 					return true;
320 320
 				}
321 321
 			}
@@ -368,7 +368,7 @@  discard block
 block discarded – undo
368 368
         if (empty($wp->query_vars) || !array_diff(array_keys($wp->query_vars), array('preview', 'page', 'paged', 'cpage'))) {
369 369
             if (get_option('geodir_set_as_home'))
370 370
                 $wp->query_vars['gd_is_geodir_page'] = true;
371
-            if(geodir_is_page('home')){
371
+            if (geodir_is_page('home')) {
372 372
                 $wp->query_vars['gd_is_geodir_page'] = true;
373 373
             }
374 374
 
@@ -420,7 +420,7 @@  discard block
 block discarded – undo
420 420
 
421 421
         if (!isset($wp->query_vars['gd_is_geodir_page'])) {
422 422
             $geodir_taxonomis = geodir_get_taxonomies('', true);
423
-            if(!empty($geodir_taxonomis)){
423
+            if (!empty($geodir_taxonomis)) {
424 424
                 foreach ($geodir_taxonomis as $taxonomy) {
425 425
                     if (array_key_exists($taxonomy, $wp->query_vars)) {
426 426
                         $wp->query_vars['gd_is_geodir_page'] = true;
@@ -440,10 +440,10 @@  discard block
 block discarded – undo
440 440
 
441 441
 
442 442
 //check if homepage
443
-        if(!isset($wp->query_vars['gd_is_geodir_page'])
443
+        if (!isset($wp->query_vars['gd_is_geodir_page'])
444 444
             && !isset($wp->query_vars['page_id'])
445 445
             && !isset($wp->query_vars['pagename'])
446
-            && is_page_geodir_home()){
446
+            && is_page_geodir_home()) {
447 447
             $wp->query_vars['gd_is_geodir_page'] = true;
448 448
         }
449 449
         //echo $wp->query_vars['gd_is_geodir_page'] ;
@@ -544,7 +544,7 @@  discard block
 block discarded – undo
544 544
     function createRandomString()
545 545
     {
546 546
         $chars = "abcdefghijkmlnopqrstuvwxyz1023456789";
547
-        srand((double)microtime() * 1000000);
547
+        srand((double) microtime() * 1000000);
548 548
         $i = 0;
549 549
         $rstring = '';
550 550
         while ($i <= 25) {
@@ -678,11 +678,11 @@  discard block
 block discarded – undo
678 678
         }
679 679
 		
680 680
 		if (!empty($subject)) {
681
-			$subject = __(stripslashes_deep($subject),'geodirectory');
681
+			$subject = __(stripslashes_deep($subject), 'geodirectory');
682 682
 		}
683 683
 		
684 684
 		if (!empty($message)) {
685
-			$message = __(stripslashes_deep($message),'geodirectory');
685
+			$message = __(stripslashes_deep($message), 'geodirectory');
686 686
 		}
687 687
 
688 688
         $to_message = nl2br($to_message);
@@ -717,12 +717,12 @@  discard block
 block discarded – undo
717 717
             $fromEmailName = get_option('site_email_name');
718 718
         }
719 719
 
720
-        $search_array = array('[#listing_link#]', '[#site_name_url#]', '[#post_id#]', '[#site_name#]', '[#to_name#]', '[#from_name#]', '[#subject#]', '[#comments#]', '[#login_url#]', '[#login_details#]', '[#client_name#]', '[#posted_date#]','[#from_email#]','[#user_login#]','[#username#]');
721
-        $replace_array = array($listingLink, $siteurl_link, $post_id, $sitefromEmailName, $toEmailName, $fromEmailName, $to_subject, $to_message, $loginurl_link, $login_details, $toEmailName, $posted_date,$fromEmail, $user_login, $user_login);
720
+        $search_array = array('[#listing_link#]', '[#site_name_url#]', '[#post_id#]', '[#site_name#]', '[#to_name#]', '[#from_name#]', '[#subject#]', '[#comments#]', '[#login_url#]', '[#login_details#]', '[#client_name#]', '[#posted_date#]', '[#from_email#]', '[#user_login#]', '[#username#]');
721
+        $replace_array = array($listingLink, $siteurl_link, $post_id, $sitefromEmailName, $toEmailName, $fromEmailName, $to_subject, $to_message, $loginurl_link, $login_details, $toEmailName, $posted_date, $fromEmail, $user_login, $user_login);
722 722
         $message = str_replace($search_array, $replace_array, $message);
723 723
 
724
-        $search_array = array('[#listing_link#]', '[#site_name_url#]', '[#post_id#]', '[#site_name#]', '[#to_name#]', '[#from_name#]', '[#subject#]', '[#client_name#]', '[#posted_date#]','[#from_email#]','[#user_login#]','[#username#]');
725
-        $replace_array = array($listingLink, $siteurl_link, $post_id, $sitefromEmailName, $toEmailName, $fromEmailName, $to_subject, $toEmailName, $posted_date,$fromEmail, $user_login, $user_login);
724
+        $search_array = array('[#listing_link#]', '[#site_name_url#]', '[#post_id#]', '[#site_name#]', '[#to_name#]', '[#from_name#]', '[#subject#]', '[#client_name#]', '[#posted_date#]', '[#from_email#]', '[#user_login#]', '[#username#]');
725
+        $replace_array = array($listingLink, $siteurl_link, $post_id, $sitefromEmailName, $toEmailName, $fromEmailName, $to_subject, $toEmailName, $posted_date, $fromEmail, $user_login, $user_login);
726 726
         $subject = str_replace($search_array, $replace_array, $subject);
727 727
 
728 728
         $headers = 'MIME-Version: 1.0' . "\r\n";
@@ -733,18 +733,18 @@  discard block
 block discarded – undo
733 733
         $to = $toEmail;
734 734
         $sent = wp_mail($to, $subject, $message, $headers);
735 735
 
736
-        if( ! $sent ) {
737
-            if ( is_array( $to ) ) {
738
-                $to = implode( ',', $to );
736
+        if (!$sent) {
737
+            if (is_array($to)) {
738
+                $to = implode(',', $to);
739 739
             }
740 740
             $log_message = sprintf(
741
-                __( "Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory' ),
741
+                __("Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory'),
742 742
                 $message_type,
743
-                date_i18n( 'F j Y H:i:s', current_time( 'timestamp' ) ),
743
+                date_i18n('F j Y H:i:s', current_time('timestamp')),
744 744
                 $to,
745 745
                 $subject
746 746
             );
747
-            geodir_error_log( $log_message );
747
+            geodir_error_log($log_message);
748 748
         }
749 749
 
750 750
         ///////// ADMIN BCC EMIALS
@@ -756,11 +756,11 @@  discard block
 block discarded – undo
756 756
             $subject = __(stripslashes_deep(get_option('geodir_post_submited_success_email_subject_admin')), 'geodirectory');
757 757
             $message = __(stripslashes_deep(get_option('geodir_post_submited_success_email_content_admin')), 'geodirectory');
758 758
 
759
-            $search_array = array('[#listing_link#]', '[#site_name_url#]', '[#post_id#]', '[#site_name#]', '[#to_name#]', '[#from_name#]', '[#subject#]', '[#comments#]', '[#login_url#]', '[#login_details#]', '[#client_name#]', '[#posted_date#]','[#user_login#]','[#username#]');
759
+            $search_array = array('[#listing_link#]', '[#site_name_url#]', '[#post_id#]', '[#site_name#]', '[#to_name#]', '[#from_name#]', '[#subject#]', '[#comments#]', '[#login_url#]', '[#login_details#]', '[#client_name#]', '[#posted_date#]', '[#user_login#]', '[#username#]');
760 760
             $replace_array = array($listingLink, $siteurl_link, $post_id, $sitefromEmailName, $toEmailName, $fromEmailName, $to_subject, $to_message, $loginurl_link, $login_details, $toEmailName, $posted_date, $user_login, $user_login);
761 761
             $message = str_replace($search_array, $replace_array, $message);
762 762
 
763
-            $search_array = array('[#listing_link#]', '[#site_name_url#]', '[#post_id#]', '[#site_name#]', '[#to_name#]', '[#from_name#]', '[#subject#]', '[#client_name#]', '[#posted_date#]','[#user_login#]','[#username#]');
763
+            $search_array = array('[#listing_link#]', '[#site_name_url#]', '[#post_id#]', '[#site_name#]', '[#to_name#]', '[#from_name#]', '[#subject#]', '[#client_name#]', '[#posted_date#]', '[#user_login#]', '[#username#]');
764 764
             $replace_array = array($listingLink, $siteurl_link, $post_id, $sitefromEmailName, $toEmailName, $fromEmailName, $to_subject, $toEmailName, $posted_date, $user_login, $user_login);
765 765
             $subject = str_replace($search_array, $replace_array, $subject);
766 766
 
@@ -785,21 +785,21 @@  discard block
 block discarded – undo
785 785
             $admin_bcc = true;
786 786
         }
787 787
 
788
-        if($admin_bcc===true){
788
+        if ($admin_bcc === true) {
789 789
             $sent = wp_mail($to, $subject, $message, $headers);
790 790
 
791
-            if( ! $sent ) {
792
-                if ( is_array( $to ) ) {
793
-                    $to = implode( ',', $to );
791
+            if (!$sent) {
792
+                if (is_array($to)) {
793
+                    $to = implode(',', $to);
794 794
                 }
795 795
                 $log_message = sprintf(
796
-                    __( "Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory' ),
796
+                    __("Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory'),
797 797
                     $message_type,
798
-                    date_i18n( 'F j Y H:i:s', current_time( 'timestamp' ) ),
798
+                    date_i18n('F j Y H:i:s', current_time('timestamp')),
799 799
                     $to,
800 800
                     $subject
801 801
                 );
802
-                geodir_error_log( $log_message );
802
+                geodir_error_log($log_message);
803 803
             }
804 804
         }
805 805
 
@@ -894,7 +894,7 @@  discard block
 block discarded – undo
894 894
             $location_manager = defined('POST_LOCATION_TABLE') ? true : false;
895 895
 			$neighbourhood_active = $location_manager && get_option('location_neighbourhoods') ? true : false;
896 896
 				
897
-			if(geodir_is_page('detail') && isset($post->country_slug)){
897
+			if (geodir_is_page('detail') && isset($post->country_slug)) {
898 898
                 $location_terms = array(
899 899
                     'gd_country' => $post->country_slug,
900 900
                     'gd_region' => $post->region_slug,
@@ -1149,7 +1149,7 @@  discard block
 block discarded – undo
1149 1149
             $breadcrumb .= stripslashes_deep($page_title);
1150 1150
             $breadcrumb .= '</li>';
1151 1151
         } else if (is_tag()) {
1152
-            $breadcrumb .=  "<li> " . $separator . single_tag_title('',false) . '</li>';
1152
+            $breadcrumb .= "<li> " . $separator . single_tag_title('', false) . '</li>';
1153 1153
         } else if (is_day()) {
1154 1154
             $breadcrumb .= "<li> " . $separator . __(" Archive for", 'geodirectory') . " ";
1155 1155
             the_time('F jS, Y');
@@ -1241,7 +1241,7 @@  discard block
 block discarded – undo
1241 1241
         return new WP_Error('upload_dir_error', $upload['error']);
1242 1242
 
1243 1243
     // fetch the remote url and write it to the placeholder file
1244
-    $headers = wp_remote_get($url, array('stream' => true,'filename' => $upload['file']));
1244
+    $headers = wp_remote_get($url, array('stream' => true, 'filename' => $upload['file']));
1245 1245
 
1246 1246
     $log_message = '';
1247 1247
     $filesize = filesize($upload['file']);
@@ -1254,16 +1254,16 @@  discard block
 block discarded – undo
1254 1254
         $log_message = sprintf(__('Remote server returned error response %1$d %2$s', 'geodirectory'), esc_html($headers['response']), get_status_header_desc($headers['response']));
1255 1255
     }
1256 1256
     elseif (isset($headers['headers']['content-length']) && $filesize != $headers['headers']['content-length']) {
1257
-        $log_message =  __('Remote file is incorrect size', 'geodirectory');
1257
+        $log_message = __('Remote file is incorrect size', 'geodirectory');
1258 1258
     }
1259 1259
     elseif (0 == $filesize) {
1260 1260
         $log_message = __('Zero size file downloaded', 'geodirectory');
1261 1261
     }
1262 1262
 
1263
-    if($log_message){
1263
+    if ($log_message) {
1264 1264
         $del = unlink($upload['file']);
1265
-        if(!$del){geodir_error_log(__('GeoDirectory: fetch_remote_file() failed to delete temp file.', 'geodirectory'));}
1266
-        return new WP_Error('import_file_error',$log_message );
1265
+        if (!$del) {geodir_error_log(__('GeoDirectory: fetch_remote_file() failed to delete temp file.', 'geodirectory')); }
1266
+        return new WP_Error('import_file_error', $log_message);
1267 1267
     }
1268 1268
 
1269 1269
 
@@ -1279,10 +1279,10 @@  discard block
 block discarded – undo
1279 1279
  */
1280 1280
 function geodir_max_upload_size()
1281 1281
 {
1282
-    $max_filesize = (float)get_option('geodir_upload_max_filesize', 2);
1282
+    $max_filesize = (float) get_option('geodir_upload_max_filesize', 2);
1283 1283
 
1284 1284
     if ($max_filesize > 0 && $max_filesize < 1) {
1285
-        $max_filesize = (int)($max_filesize * 1024) . 'kb';
1285
+        $max_filesize = (int) ($max_filesize * 1024) . 'kb';
1286 1286
     } else {
1287 1287
         $max_filesize = $max_filesize > 0 ? $max_filesize . 'mb' : '2mb';
1288 1288
     }
@@ -1351,35 +1351,35 @@  discard block
 block discarded – undo
1351 1351
     {
1352 1352
         global $wpdb;
1353 1353
         if ($message_type == 'expiration') {
1354
-            $subject = stripslashes(__(get_option('renew_email_subject'),'geodirectory'));
1355
-            $client_message = stripslashes(__(get_option('renew_email_content'),'geodirectory'));
1354
+            $subject = stripslashes(__(get_option('renew_email_subject'), 'geodirectory'));
1355
+            $client_message = stripslashes(__(get_option('renew_email_content'), 'geodirectory'));
1356 1356
         } elseif ($message_type == 'post_submited') {
1357
-            $subject = __(get_option('post_submited_success_email_subject_admin'),'geodirectory');
1358
-            $client_message = __(get_option('post_submited_success_email_content_admin'),'geodirectory');
1357
+            $subject = __(get_option('post_submited_success_email_subject_admin'), 'geodirectory');
1358
+            $client_message = __(get_option('post_submited_success_email_content_admin'), 'geodirectory');
1359 1359
         } elseif ($message_type == 'renew') {
1360
-            $subject = __(get_option('post_renew_success_email_subject_admin'),'geodirectory');
1361
-            $client_message = __(get_option('post_renew_success_email_content_admin'),'geodirectory');
1360
+            $subject = __(get_option('post_renew_success_email_subject_admin'), 'geodirectory');
1361
+            $client_message = __(get_option('post_renew_success_email_content_admin'), 'geodirectory');
1362 1362
         } elseif ($message_type == 'upgrade') {
1363
-            $subject = __(get_option('post_upgrade_success_email_subject_admin'),'geodirectory');
1364
-            $client_message = __(get_option('post_upgrade_success_email_content_admin'),'geodirectory');
1363
+            $subject = __(get_option('post_upgrade_success_email_subject_admin'), 'geodirectory');
1364
+            $client_message = __(get_option('post_upgrade_success_email_content_admin'), 'geodirectory');
1365 1365
         } elseif ($message_type == 'claim_approved') {
1366
-            $subject = __(get_option('claim_approved_email_subject'),'geodirectory');
1367
-            $client_message = __(get_option('claim_approved_email_content'),'geodirectory');
1366
+            $subject = __(get_option('claim_approved_email_subject'), 'geodirectory');
1367
+            $client_message = __(get_option('claim_approved_email_content'), 'geodirectory');
1368 1368
         } elseif ($message_type == 'claim_rejected') {
1369
-            $subject = __(get_option('claim_rejected_email_subject'),'geodirectory');
1370
-            $client_message = __(get_option('claim_rejected_email_content'),'geodirectory');
1369
+            $subject = __(get_option('claim_rejected_email_subject'), 'geodirectory');
1370
+            $client_message = __(get_option('claim_rejected_email_content'), 'geodirectory');
1371 1371
         } elseif ($message_type == 'claim_requested') {
1372
-            $subject = __(get_option('claim_email_subject_admin'),'geodirectory');
1373
-            $client_message = __(get_option('claim_email_content_admin'),'geodirectory');
1372
+            $subject = __(get_option('claim_email_subject_admin'), 'geodirectory');
1373
+            $client_message = __(get_option('claim_email_content_admin'), 'geodirectory');
1374 1374
         } elseif ($message_type == 'auto_claim') {
1375
-            $subject = __(get_option('auto_claim_email_subject'),'geodirectory');
1376
-            $client_message = __(get_option('auto_claim_email_content'),'geodirectory');
1375
+            $subject = __(get_option('auto_claim_email_subject'), 'geodirectory');
1376
+            $client_message = __(get_option('auto_claim_email_content'), 'geodirectory');
1377 1377
         } elseif ($message_type == 'payment_success') {
1378
-            $subject = __(get_option('post_payment_success_admin_email_subject'),'geodirectory');
1379
-            $client_message = __(get_option('post_payment_success_admin_email_content'),'geodirectory');
1378
+            $subject = __(get_option('post_payment_success_admin_email_subject'), 'geodirectory');
1379
+            $client_message = __(get_option('post_payment_success_admin_email_content'), 'geodirectory');
1380 1380
         } elseif ($message_type == 'payment_fail') {
1381
-            $subject = __(get_option('post_payment_fail_admin_email_subject'),'geodirectory');
1382
-            $client_message = __(get_option('post_payment_fail_admin_email_content'),'geodirectory');
1381
+            $subject = __(get_option('post_payment_fail_admin_email_subject'), 'geodirectory');
1382
+            $client_message = __(get_option('post_payment_fail_admin_email_content'), 'geodirectory');
1383 1383
         }
1384 1384
         $transaction_details = $custom_1;
1385 1385
         $fromEmail = get_option('site_email');
@@ -1420,18 +1420,18 @@  discard block
 block discarded – undo
1420 1420
         $to = $fromEmail;
1421 1421
         $message = $client_message;
1422 1422
         $sent = wp_mail($to, $subject, $message, $headers);
1423
-        if( ! $sent ) {
1424
-            if ( is_array( $to ) ) {
1425
-                $to = implode( ',', $to );
1423
+        if (!$sent) {
1424
+            if (is_array($to)) {
1425
+                $to = implode(',', $to);
1426 1426
             }
1427 1427
             $log_message = sprintf(
1428
-                __( "Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory' ),
1428
+                __("Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory'),
1429 1429
                 $message_type,
1430
-                date_i18n( 'F j Y H:i:s', current_time( 'timestamp' ) ),
1430
+                date_i18n('F j Y H:i:s', current_time('timestamp')),
1431 1431
                 $to,
1432 1432
                 $subject
1433 1433
             );
1434
-            geodir_error_log( $log_message );
1434
+            geodir_error_log($log_message);
1435 1435
         }
1436 1436
     }
1437 1437
 }
@@ -1457,18 +1457,18 @@  discard block
 block discarded – undo
1457 1457
     {
1458 1458
         $login_details = '';
1459 1459
         if ($message_type == 'send_friend') {
1460
-            $subject = stripslashes(__(get_option('email_friend_subject'),'geodirectory'));
1461
-            $message = stripslashes(__(get_option('email_friend_content'),'geodirectory'));
1460
+            $subject = stripslashes(__(get_option('email_friend_subject'), 'geodirectory'));
1461
+            $message = stripslashes(__(get_option('email_friend_content'), 'geodirectory'));
1462 1462
         } elseif ($message_type == 'send_enquiry') {
1463
-            $subject = __(get_option('email_enquiry_subject'),'geodirectory');
1464
-            $message = __(get_option('email_enquiry_content'),'geodirectory');
1463
+            $subject = __(get_option('email_enquiry_subject'), 'geodirectory');
1464
+            $message = __(get_option('email_enquiry_content'), 'geodirectory');
1465 1465
         } elseif ($message_type == 'forgot_password') {
1466
-            $subject = __(get_option('forgot_password_subject'),'geodirectory');
1467
-            $message = __(get_option('forgot_password_content'),'geodirectory');
1466
+            $subject = __(get_option('forgot_password_subject'), 'geodirectory');
1467
+            $message = __(get_option('forgot_password_content'), 'geodirectory');
1468 1468
             $login_details = $to_message;
1469 1469
         } elseif ($message_type == 'registration') {
1470
-            $subject = __(get_option('registration_success_email_subject'),'geodirectory');
1471
-            $message = __(get_option('registration_success_email_content'),'geodirectory');
1470
+            $subject = __(get_option('registration_success_email_subject'), 'geodirectory');
1471
+            $message = __(get_option('registration_success_email_content'), 'geodirectory');
1472 1472
             $login_details = $to_message;
1473 1473
         }
1474 1474
         $to_message = nl2br($to_message);
@@ -1502,18 +1502,18 @@  discard block
 block discarded – undo
1502 1502
         $to = $toEmail;
1503 1503
 
1504 1504
         $sent = wp_mail($to, $subject, $message, $headers);
1505
-        if( ! $sent ) {
1506
-            if ( is_array( $to ) ) {
1507
-                $to = implode( ',', $to );
1505
+        if (!$sent) {
1506
+            if (is_array($to)) {
1507
+                $to = implode(',', $to);
1508 1508
             }
1509 1509
             $log_message = sprintf(
1510
-                __( "Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory' ),
1510
+                __("Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory'),
1511 1511
                 $message_type,
1512
-                date_i18n( 'F j Y H:i:s', current_time( 'timestamp' ) ),
1512
+                date_i18n('F j Y H:i:s', current_time('timestamp')),
1513 1513
                 $to,
1514 1514
                 $subject
1515 1515
             );
1516
-            geodir_error_log( $log_message );
1516
+            geodir_error_log($log_message);
1517 1517
         }
1518 1518
 
1519 1519
         ///////// ADMIN BCC EMIALS
@@ -1539,20 +1539,20 @@  discard block
 block discarded – undo
1539 1539
             $admin_bcc = true;
1540 1540
         }
1541 1541
 
1542
-        if($admin_bcc === true){
1542
+        if ($admin_bcc === true) {
1543 1543
             $sent = wp_mail($to, $subject, $message, $headers);
1544
-            if( ! $sent ) {
1545
-                if ( is_array( $to ) ) {
1546
-                    $to = implode( ',', $to );
1544
+            if (!$sent) {
1545
+                if (is_array($to)) {
1546
+                    $to = implode(',', $to);
1547 1547
                 }
1548 1548
                 $log_message = sprintf(
1549
-                    __( "Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory' ),
1549
+                    __("Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory'),
1550 1550
                     $message_type,
1551
-                    date_i18n( 'F j Y H:i:s', current_time( 'timestamp' ) ),
1551
+                    date_i18n('F j Y H:i:s', current_time('timestamp')),
1552 1552
                     $to,
1553 1553
                     $subject
1554 1554
                 );
1555
-                geodir_error_log( $log_message );
1555
+                geodir_error_log($log_message);
1556 1556
             }
1557 1557
         }
1558 1558
 
@@ -1600,7 +1600,7 @@  discard block
 block discarded – undo
1600 1600
 function geodir_custom_posts_body_class($classes) {
1601 1601
     global $wpdb, $wp;
1602 1602
     $post_types = geodir_get_posttypes('object');
1603
-    if (!empty($post_types) && count((array)$post_types) > 1) {
1603
+    if (!empty($post_types) && count((array) $post_types) > 1) {
1604 1604
         $classes[] = 'geodir_custom_posts';
1605 1605
     }
1606 1606
 
@@ -1894,7 +1894,7 @@  discard block
 block discarded – undo
1894 1894
         $sql = "SELECT COUNT(" . $wpdb->posts . ".ID) AS total FROM " . $wpdb->posts . "
1895 1895
 			" . $join . "
1896 1896
 			" . $where;
1897
-        $rows = (int)$wpdb->get_var($sql);
1897
+        $rows = (int) $wpdb->get_var($sql);
1898 1898
     } else {
1899 1899
         $orderby = geodir_widget_listings_get_order($query_args);
1900 1900
         /**
@@ -1920,10 +1920,10 @@  discard block
 block discarded – undo
1920 1920
         $limit = apply_filters('geodir_filter_widget_listings_limit', $limit, $post_type);
1921 1921
 
1922 1922
         $page = !empty($query_args['pageno']) ? absint($query_args['pageno']) : 1;
1923
-        if ( !$page )
1923
+        if (!$page)
1924 1924
             $page = 1;
1925 1925
 
1926
-        $limit = (int)$limit > 0 ? " LIMIT " . absint( ( $page - 1 ) * (int)$limit ) . ", " . (int)$limit : "";
1926
+        $limit = (int) $limit > 0 ? " LIMIT " . absint(($page - 1) * (int) $limit) . ", " . (int) $limit : "";
1927 1927
 
1928 1928
         $sql = "SELECT SQL_CALC_FOUND_ROWS " . $fields . " FROM " . $wpdb->posts . "
1929 1929
 			" . $join . "
@@ -2038,7 +2038,7 @@  discard block
 block discarded – undo
2038 2038
         }
2039 2039
 
2040 2040
         if (!empty($query_args['post_author'])) {
2041
-            $where .= " AND " . $wpdb->posts . ".post_author = " . (int)$query_args['post_author'];
2041
+            $where .= " AND " . $wpdb->posts . ".post_author = " . (int) $query_args['post_author'];
2042 2042
         }
2043 2043
         
2044 2044
         if (!empty($query_args['show_featured_only'])) {
@@ -2124,7 +2124,7 @@  discard block
 block discarded – undo
2124 2124
     }
2125 2125
 
2126 2126
     if (!empty($query_args) && !empty($query_args['posts_per_page'])) {
2127
-        $limit = (int)$query_args['posts_per_page'];
2127
+        $limit = (int) $query_args['posts_per_page'];
2128 2128
     }
2129 2129
 
2130 2130
     return $limit;
@@ -2267,9 +2267,9 @@  discard block
 block discarded – undo
2267 2267
         add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2);
2268 2268
     }
2269 2269
     $home_url = str_replace("www.", "", $home_url);
2270
-    if ( (strpos($home_url, $cur_url) !== false || strpos($home_url . '/', $cur_url) !== false) && ('page' == get_option('show_on_front') && get_option('page_on_front') && get_option('page_on_front')==get_option('geodir_home_page')) ) {
2270
+    if ((strpos($home_url, $cur_url) !== false || strpos($home_url . '/', $cur_url) !== false) && ('page' == get_option('show_on_front') && get_option('page_on_front') && get_option('page_on_front') == get_option('geodir_home_page'))) {
2271 2271
         return true;
2272
-    }elseif(get_query_var('page_id') == get_option('page_on_front') && 'page' == get_option('show_on_front') && get_option('page_on_front') && get_option('page_on_front')==get_option('geodir_home_page')){
2272
+    }elseif (get_query_var('page_id') == get_option('page_on_front') && 'page' == get_option('show_on_front') && get_option('page_on_front') && get_option('page_on_front') == get_option('geodir_home_page')) {
2273 2273
         return true;
2274 2274
     } else {
2275 2275
         return false;
@@ -2352,7 +2352,7 @@  discard block
 block discarded – undo
2352 2352
 
2353 2353
     $gd_post_type = geodir_get_current_posttype();
2354 2354
 
2355
-    $category_limit = isset($instance['category_limit']) && $instance['category_limit'] > 0 ? (int)$instance['category_limit'] : 15;
2355
+    $category_limit = isset($instance['category_limit']) && $instance['category_limit'] > 0 ? (int) $instance['category_limit'] : 15;
2356 2356
     $default_post_type = !empty($gd_post_type) ? $gd_post_type : (isset($instance['default_post_type']) && gdsc_is_post_type_valid($instance['default_post_type']) ? $instance['default_post_type'] : '');
2357 2357
 
2358 2358
     $taxonomy = array();
@@ -2385,14 +2385,14 @@  discard block
 block discarded – undo
2385 2385
             foreach ($b_terms as $key => $val) {
2386 2386
                 $ptype = get_post_type_object(str_replace("category", "", $key));
2387 2387
                 $cpt_name = __($ptype->labels->singular_name, 'geodirectory');
2388
-                $tax_change_output .= "<option value='$key' ". selected($key, $default_taxonomy, false) .">" . sprintf(__('%s Categories', 'geodirectory'),$cpt_name) . "</option>";
2388
+                $tax_change_output .= "<option value='$key' " . selected($key, $default_taxonomy, false) . ">" . sprintf(__('%s Categories', 'geodirectory'), $cpt_name) . "</option>";
2389 2389
             }
2390 2390
             $tax_change_output .= "</select>";
2391 2391
         }
2392 2392
 
2393 2393
         if (!empty($b_terms)) {
2394
-            $terms = $default_taxonomy != '' && isset($b_terms[$default_taxonomy]) ? $b_terms[$default_taxonomy] : reset($b_terms);// get the first array
2395
-            global $cat_count;//make global so we can change via function
2394
+            $terms = $default_taxonomy != '' && isset($b_terms[$default_taxonomy]) ? $b_terms[$default_taxonomy] : reset($b_terms); // get the first array
2395
+            global $cat_count; //make global so we can change via function
2396 2396
             $cat_count = 0;
2397 2397
             ?>
2398 2398
             <div class="geodir-category-list-in clearfix">
@@ -2456,7 +2456,7 @@  discard block
 block discarded – undo
2456 2456
         $class_row = $cat_count > $category_limit ? 'geodir-pcat-hide geodir-hide' : 'geodir-pcat-show';
2457 2457
         $total_post = $cat->count;
2458 2458
 
2459
-        $term_link = get_term_link( $cat, $cat->taxonomy );
2459
+        $term_link = get_term_link($cat, $cat->taxonomy);
2460 2460
         /**
2461 2461
          * Filer the category term link.
2462 2462
          *
@@ -2465,7 +2465,7 @@  discard block
 block discarded – undo
2465 2465
          * @param int    $cat->term_id The term id.
2466 2466
          * @param string $post_type Wordpress post type.
2467 2467
          */
2468
-        $term_link = apply_filters( 'geodir_category_term_link', $term_link, $cat->term_id, $post_type );
2468
+        $term_link = apply_filters('geodir_category_term_link', $term_link, $cat->term_id, $post_type);
2469 2469
 
2470 2470
         echo '<li class="' . $class_row . '"><a href="' . $term_link . '">';
2471 2471
         echo '<img alt="' . esc_attr($cat->name) . ' icon" style="height:20px;vertical-align:middle;" src="' . $term_icon_url . '"/> <span class="cat-link">'; echo $cat->name . '</span> <span class="geodir_term_class geodir_link_span geodir_category_class_' . $post_type . '_' . $cat->term_id . '">(' . $total_post . ')</span> ';
@@ -2599,29 +2599,29 @@  discard block
 block discarded – undo
2599 2599
                 itemWidth: 75,
2600 2600
                 itemMargin: 5,
2601 2601
                 asNavFor: '#geodir_widget_slider',
2602
-                rtl: <?php echo ( is_rtl() ? 'true' : 'false' ); /* fix rtl issue */ ?>
2602
+                rtl: <?php echo (is_rtl() ? 'true' : 'false'); /* fix rtl issue */ ?>
2603 2603
             });
2604 2604
 
2605 2605
             jQuery('#geodir_widget_slider').flexslider({
2606
-                animation: "<?php echo $animation;?>",
2606
+                animation: "<?php echo $animation; ?>",
2607 2607
                 selector: ".geodir-slides > li",
2608 2608
                 namespace: "geodir-",
2609 2609
                 controlNav: true,
2610
-                animationLoop: <?php echo $animationLoop;?>,
2611
-                slideshow: <?php echo $slideshow;?>,
2612
-                slideshowSpeed: <?php echo $slideshowSpeed;?>,
2613
-                animationSpeed: <?php echo $animationSpeed;?>,
2614
-                directionNav: <?php echo $directionNav;?>,
2615
-                maxItems: <?php echo $max_show;?>,
2610
+                animationLoop: <?php echo $animationLoop; ?>,
2611
+                slideshow: <?php echo $slideshow; ?>,
2612
+                slideshowSpeed: <?php echo $slideshowSpeed; ?>,
2613
+                animationSpeed: <?php echo $animationSpeed; ?>,
2614
+                directionNav: <?php echo $directionNav; ?>,
2615
+                maxItems: <?php echo $max_show; ?>,
2616 2616
                 move: 1,
2617
-                <?php if($slide_width){ echo "itemWidth: ".$slide_width.",";}?>
2617
+                <?php if ($slide_width) { echo "itemWidth: " . $slide_width . ","; }?>
2618 2618
                 sync: "#geodir_widget_carousel",
2619 2619
                 start: function (slider) {
2620 2620
                     jQuery('.geodir-listing-flex-loader').hide();
2621 2621
                     jQuery('#geodir_widget_slider').css({'visibility': 'visible'});
2622 2622
                     jQuery('#geodir_widget_carousel').css({'visibility': 'visible'});
2623 2623
                 },
2624
-                rtl: <?php echo ( is_rtl() ? 'true' : 'false' ); /* fix rtl issue */ ?>
2624
+                rtl: <?php echo (is_rtl() ? 'true' : 'false'); /* fix rtl issue */ ?>
2625 2625
             });
2626 2626
         });
2627 2627
     </script>
@@ -2662,7 +2662,7 @@  discard block
 block discarded – undo
2662 2662
 
2663 2663
         global $post;
2664 2664
 
2665
-        $current_post = $post;// keep current post info
2665
+        $current_post = $post; // keep current post info
2666 2666
 
2667 2667
         $widget_main_slides = '';
2668 2668
         $nav_slides = '';
@@ -3105,7 +3105,7 @@  discard block
 block discarded – undo
3105 3105
             $geodir_add_location_url = '1';
3106 3106
         }
3107 3107
 
3108
-        $viewall_url = get_term_link((int)$category[0], $post_type . 'category');
3108
+        $viewall_url = get_term_link((int) $category[0], $post_type . 'category');
3109 3109
 
3110 3110
         $geodir_add_location_url = NULL;
3111 3111
     }
@@ -3113,7 +3113,7 @@  discard block
 block discarded – undo
3113 3113
         $gd_session->set('gd_multi_location', 1);
3114 3114
     }
3115 3115
 
3116
-    if(is_wp_error( $viewall_url  )){$viewall_url = '';}
3116
+    if (is_wp_error($viewall_url)) {$viewall_url = ''; }
3117 3117
 
3118 3118
     $query_args = array(
3119 3119
         'posts_per_page' => $post_number,
@@ -3351,14 +3351,14 @@  discard block
 block discarded – undo
3351 3351
  * @package GeoDirectory
3352 3352
  * @return bool
3353 3353
  */
3354
-function geodir_term_review_count_force_update($new_status, $old_status='', $post='')
3354
+function geodir_term_review_count_force_update($new_status, $old_status = '', $post = '')
3355 3355
 {
3356
-    if(isset($_REQUEST['action']) && $_REQUEST['action']=='geodir_import_export'){return;}//do not run if importing listings
3356
+    if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'geodir_import_export') {return; }//do not run if importing listings
3357 3357
 
3358
-    if(isset($post->post_type) && ($post->post_type=='nav_menu_item' || $post->post_type=='page' || $post->post_type=='post')){
3358
+    if (isset($post->post_type) && ($post->post_type == 'nav_menu_item' || $post->post_type == 'page' || $post->post_type == 'post')) {
3359 3359
         return;
3360 3360
     }
3361
-    if($new_status!=$old_status) {
3361
+    if ($new_status != $old_status) {
3362 3362
         geodir_count_reviews_by_terms(true);
3363 3363
     }
3364 3364
     return true;
@@ -3523,7 +3523,7 @@  discard block
 block discarded – undo
3523 3523
          */
3524 3524
         try {
3525 3525
             require_once($language_file);
3526
-        } catch(Exception $e) {
3526
+        } catch (Exception $e) {
3527 3527
             error_log('Language Error: ' . $e->getMessage());
3528 3528
         }
3529 3529
     }
@@ -3541,18 +3541,18 @@  discard block
 block discarded – undo
3541 3541
  */
3542 3542
 function geodirectory_load_db_language() {
3543 3543
     global $wp_filesystem;
3544
-    if( empty( $wp_filesystem ) ) {
3545
-        require_once( ABSPATH .'/wp-admin/includes/file.php' );
3544
+    if (empty($wp_filesystem)) {
3545
+        require_once(ABSPATH . '/wp-admin/includes/file.php');
3546 3546
         WP_Filesystem();
3547 3547
         global $wp_filesystem;
3548 3548
     }
3549 3549
 
3550 3550
     $language_file = geodir_plugin_path() . '/db-language.php';
3551 3551
 
3552
-    if(is_file($language_file) && !is_writable($language_file))
3552
+    if (is_file($language_file) && !is_writable($language_file))
3553 3553
         return false; // Not possible to create.
3554 3554
 
3555
-    if(!is_file($language_file) && !is_writable(dirname($language_file)))
3555
+    if (!is_file($language_file) && !is_writable(dirname($language_file)))
3556 3556
         return false; // Not possible to create.
3557 3557
 
3558 3558
     $contents_strings = array();
@@ -3586,7 +3586,7 @@  discard block
 block discarded – undo
3586 3586
     $contents = implode(PHP_EOL, $contents_head);
3587 3587
 
3588 3588
     if (!empty($contents_strings)) {
3589
-        foreach ( $contents_strings as $string ) {
3589
+        foreach ($contents_strings as $string) {
3590 3590
             if (is_scalar($string) && $string != '') {
3591 3591
                 $string = str_replace("'", "\'", $string);
3592 3592
                 $contents .= PHP_EOL . "__('" . $string . "', 'geodirectory');";
@@ -3596,7 +3596,7 @@  discard block
 block discarded – undo
3596 3596
 
3597 3597
     $contents .= implode(PHP_EOL, $contents_foot);
3598 3598
 
3599
-    if($wp_filesystem->put_contents( $language_file, $contents, FS_CHMOD_FILE))
3599
+    if ($wp_filesystem->put_contents($language_file, $contents, FS_CHMOD_FILE))
3600 3600
         return false; // Failure; could not write file.
3601 3601
 
3602 3602
     return true;
@@ -3622,7 +3622,7 @@  discard block
 block discarded – undo
3622 3622
     $rows = $wpdb->get_results($sql);
3623 3623
 
3624 3624
     if (!empty($rows)) {
3625
-        foreach($rows as $row) {
3625
+        foreach ($rows as $row) {
3626 3626
             if (!empty($row->admin_title))
3627 3627
                 $translation_texts[] = stripslashes_deep($row->admin_title);
3628 3628
 			
@@ -3660,7 +3660,7 @@  discard block
 block discarded – undo
3660 3660
     $rows = $wpdb->get_results($sql);
3661 3661
 
3662 3662
     if (!empty($rows)) {
3663
-        foreach($rows as $row) {
3663
+        foreach ($rows as $row) {
3664 3664
             if (!empty($row->site_title))
3665 3665
                 $translation_texts[] = stripslashes_deep($row->site_title);
3666 3666
 
@@ -3678,7 +3678,7 @@  discard block
 block discarded – undo
3678 3678
 		$rows = $wpdb->get_results($sql);
3679 3679
 
3680 3680
 		if (!empty($rows)) {
3681
-			foreach($rows as $row) {
3681
+			foreach ($rows as $row) {
3682 3682
 				if (!empty($row->field_site_name))
3683 3683
 					$translation_texts[] = stripslashes_deep($row->field_site_name);
3684 3684
 
@@ -3713,7 +3713,7 @@  discard block
 block discarded – undo
3713 3713
      *
3714 3714
      * @param array $geodir_allowed_mime_types and file extensions.
3715 3715
      */
3716
-    return apply_filters( 'geodir_allowed_mime_types', array(
3716
+    return apply_filters('geodir_allowed_mime_types', array(
3717 3717
             'Image' => array( // Image formats.
3718 3718
                 'jpg' => 'image/jpeg',
3719 3719
                 'jpe' => 'image/jpeg',
@@ -3802,13 +3802,13 @@  discard block
 block discarded – undo
3802 3802
 
3803 3803
 
3804 3804
 
3805
-add_filter('wpseo_replacements','geodir_wpseo_replacements',10,1);
3805
+add_filter('wpseo_replacements', 'geodir_wpseo_replacements', 10, 1);
3806 3806
 /*
3807 3807
  * Add location variables to wpseo replacements.
3808 3808
  *
3809 3809
  * @since 1.5.4
3810 3810
  */
3811
-function geodir_wpseo_replacements($vars){
3811
+function geodir_wpseo_replacements($vars) {
3812 3812
 
3813 3813
     global $wp;
3814 3814
     $title = '';
@@ -3823,12 +3823,12 @@  discard block
 block discarded – undo
3823 3823
      * @param array $location_array The array of location variables.
3824 3824
      * @param array $vars The page title variables.
3825 3825
      */
3826
-    $location_array = apply_filters('geodir_filter_title_variables_location_arr_seo',$location_array, $vars);
3826
+    $location_array = apply_filters('geodir_filter_title_variables_location_arr_seo', $location_array, $vars);
3827 3827
     $location_titles = array();
3828
-    if(get_query_var( 'gd_country_full' )){
3829
-        if(get_query_var( 'gd_country_full' )){$location_array['gd_country'] = get_query_var( 'gd_country_full' );}
3830
-        if(get_query_var( 'gd_region_full' )){$location_array['gd_region'] = get_query_var( 'gd_region_full' );}
3831
-        if(get_query_var( 'gd_city_full' )){$location_array['gd_city'] = get_query_var( 'gd_city_full' );}
3828
+    if (get_query_var('gd_country_full')) {
3829
+        if (get_query_var('gd_country_full')) {$location_array['gd_country'] = get_query_var('gd_country_full'); }
3830
+        if (get_query_var('gd_region_full')) {$location_array['gd_region'] = get_query_var('gd_region_full'); }
3831
+        if (get_query_var('gd_city_full')) {$location_array['gd_city'] = get_query_var('gd_city_full'); }
3832 3832
     }
3833 3833
     $location_single = '';
3834 3834
     $gd_country = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : '';
@@ -3900,23 +3900,23 @@  discard block
 block discarded – undo
3900 3900
     }
3901 3901
 
3902 3902
 
3903
-    if(!empty($location_titles)) {
3903
+    if (!empty($location_titles)) {
3904 3904
         $vars['%%location%%'] = implode(", ", $location_titles);
3905 3905
     }
3906 3906
 
3907 3907
 
3908
-    if(!empty($location_titles)) {
3908
+    if (!empty($location_titles)) {
3909 3909
         $vars['%%in_location%%'] = __('in ', 'geodirectory') . implode(", ", $location_titles);
3910 3910
     }
3911 3911
 
3912 3912
 
3913 3913
 
3914
-    if($location_single) {
3915
-        $vars['%%in_location_single%%'] = __('in', 'geodirectory') . ' ' .$location_single;
3914
+    if ($location_single) {
3915
+        $vars['%%in_location_single%%'] = __('in', 'geodirectory') . ' ' . $location_single;
3916 3916
     }
3917 3917
 
3918 3918
 
3919
-    if($location_single) {
3919
+    if ($location_single) {
3920 3920
         $vars['%%location_single%%'] = $location_single;
3921 3921
     }
3922 3922
 
@@ -3928,17 +3928,17 @@  discard block
 block discarded – undo
3928 3928
      * @param string $vars The title with variables.
3929 3929
      * @param array $location_array The array of location variables.
3930 3930
      */
3931
-    return apply_filters('geodir_wpseo_replacements_vars',$vars,$location_array);
3931
+    return apply_filters('geodir_wpseo_replacements_vars', $vars, $location_array);
3932 3932
 }
3933 3933
 
3934 3934
 
3935
-add_filter('geodir_seo_meta_title','geodir_filter_title_variables',10,3);
3936
-add_filter('geodir_seo_page_title','geodir_filter_title_variables',10,2);
3937
-add_filter('geodir_seo_meta_description_pre','geodir_filter_title_variables',10,3);
3938
-function geodir_filter_title_variables($title, $gd_page, $sep=''){
3935
+add_filter('geodir_seo_meta_title', 'geodir_filter_title_variables', 10, 3);
3936
+add_filter('geodir_seo_page_title', 'geodir_filter_title_variables', 10, 2);
3937
+add_filter('geodir_seo_meta_description_pre', 'geodir_filter_title_variables', 10, 3);
3938
+function geodir_filter_title_variables($title, $gd_page, $sep = '') {
3939 3939
 
3940 3940
 
3941
-    if(!$gd_page || !$title){return $title;}// if no a GD page then bail.
3941
+    if (!$gd_page || !$title) {return $title; }// if no a GD page then bail.
3942 3942
     global $post;
3943 3943
     //print_r($post);
3944 3944
     /*
@@ -3980,119 +3980,119 @@  discard block
 block discarded – undo
3980 3980
     }
3981 3981
 
3982 3982
 
3983
-    if(strpos($title,'%%title%%') !== false){
3984
-        $title = str_replace("%%title%%",$post->post_title,$title);
3983
+    if (strpos($title, '%%title%%') !== false) {
3984
+        $title = str_replace("%%title%%", $post->post_title, $title);
3985 3985
     }
3986 3986
 
3987
-    if(strpos($title,'%%sitename%%') !== false){
3988
-        $title = str_replace("%%sitename%%",get_bloginfo('name'),$title);
3987
+    if (strpos($title, '%%sitename%%') !== false) {
3988
+        $title = str_replace("%%sitename%%", get_bloginfo('name'), $title);
3989 3989
     }
3990 3990
 
3991
-    if(strpos($title,'%%sitedesc%%') !== false){
3992
-        $title = str_replace("%%sitedesc%%",get_bloginfo('description'),$title);
3991
+    if (strpos($title, '%%sitedesc%%') !== false) {
3992
+        $title = str_replace("%%sitedesc%%", get_bloginfo('description'), $title);
3993 3993
     }
3994 3994
 
3995
-    if(strpos($title,'%%excerpt%%') !== false){
3996
-        $title = str_replace("%%excerpt%%",strip_tags(get_the_excerpt()),$title);
3995
+    if (strpos($title, '%%excerpt%%') !== false) {
3996
+        $title = str_replace("%%excerpt%%", strip_tags(get_the_excerpt()), $title);
3997 3997
     }
3998 3998
 
3999
-    if(strpos($title,'%%pt_single%%') !== false){
3999
+    if (strpos($title, '%%pt_single%%') !== false) {
4000 4000
         $single_name = '';
4001
-        if($gd_page=='search' || $gd_page=='author'){
4001
+        if ($gd_page == 'search' || $gd_page == 'author') {
4002 4002
             $geodir_post_types = get_option('geodir_post_types');
4003 4003
             $spt = esc_attr($_REQUEST['stype']);
4004
-            if(isset($geodir_post_types[$spt]['labels']['singular_name'])){
4005
-                $single_name = __($geodir_post_types[$spt]['labels']['singular_name'],'geodirectory');
4004
+            if (isset($geodir_post_types[$spt]['labels']['singular_name'])) {
4005
+                $single_name = __($geodir_post_types[$spt]['labels']['singular_name'], 'geodirectory');
4006 4006
             }
4007
-        }elseif($gd_page=='add-listing'){
4007
+        }elseif ($gd_page == 'add-listing') {
4008 4008
             $geodir_post_types = get_option('geodir_post_types');
4009 4009
             $spt = isset($_REQUEST['listing_type']) ? esc_attr($_REQUEST['listing_type']) : '';
4010
-            if(!$spt && isset($_REQUEST['pid'])){
4011
-                $spt = get_post_type( $_REQUEST['pid'] );
4010
+            if (!$spt && isset($_REQUEST['pid'])) {
4011
+                $spt = get_post_type($_REQUEST['pid']);
4012 4012
             }
4013
-            if(!$spt){$spt='gd_place';}
4014
-            if(isset($geodir_post_types[$spt]['labels']['singular_name'])){
4015
-                $single_name = __($geodir_post_types[$spt]['labels']['singular_name'],'geodirectory');
4013
+            if (!$spt) {$spt = 'gd_place'; }
4014
+            if (isset($geodir_post_types[$spt]['labels']['singular_name'])) {
4015
+                $single_name = __($geodir_post_types[$spt]['labels']['singular_name'], 'geodirectory');
4016 4016
             }
4017 4017
         }
4018
-        elseif($post->post_type){
4018
+        elseif ($post->post_type) {
4019 4019
             $geodir_post_types = get_option('geodir_post_types');
4020
-            if(isset($geodir_post_types[$post->post_type]['labels']['singular_name'])){
4021
-                $single_name = __($geodir_post_types[$post->post_type]['labels']['singular_name'],'geodirectory');
4020
+            if (isset($geodir_post_types[$post->post_type]['labels']['singular_name'])) {
4021
+                $single_name = __($geodir_post_types[$post->post_type]['labels']['singular_name'], 'geodirectory');
4022 4022
             }
4023 4023
 
4024 4024
 
4025 4025
         }
4026
-        $title = str_replace("%%pt_single%%",$single_name,$title);
4026
+        $title = str_replace("%%pt_single%%", $single_name, $title);
4027 4027
     }
4028 4028
 
4029
-    if(strpos($title,'%%pt_plural%%') !== false){
4029
+    if (strpos($title, '%%pt_plural%%') !== false) {
4030 4030
         $plural_name = '';
4031
-        if($gd_page=='search' || $gd_page=='author'){
4031
+        if ($gd_page == 'search' || $gd_page == 'author') {
4032 4032
             $geodir_post_types = get_option('geodir_post_types');
4033 4033
             $spt = esc_attr($_REQUEST['stype']);
4034
-            if(isset($geodir_post_types[$spt]['labels']['name'])){
4035
-                $plural_name = __($geodir_post_types[$spt]['labels']['name'],'geodirectory');
4034
+            if (isset($geodir_post_types[$spt]['labels']['name'])) {
4035
+                $plural_name = __($geodir_post_types[$spt]['labels']['name'], 'geodirectory');
4036 4036
             }
4037
-        }elseif($gd_page=='add-listing'){
4037
+        }elseif ($gd_page == 'add-listing') {
4038 4038
             $geodir_post_types = get_option('geodir_post_types');
4039 4039
             $spt = sanitize_text_field($_REQUEST['listing_type']);
4040
-            if(!$spt){$spt='gd_place';}
4041
-            if(isset($geodir_post_types[$spt]['labels']['name'])){
4042
-                $plural_name = __($geodir_post_types[$spt]['labels']['name'],'geodirectory');
4040
+            if (!$spt) {$spt = 'gd_place'; }
4041
+            if (isset($geodir_post_types[$spt]['labels']['name'])) {
4042
+                $plural_name = __($geodir_post_types[$spt]['labels']['name'], 'geodirectory');
4043 4043
             }
4044 4044
         }
4045
-        elseif(isset($post->post_type) && $post->post_type){
4045
+        elseif (isset($post->post_type) && $post->post_type) {
4046 4046
             $geodir_post_types = get_option('geodir_post_types');
4047
-            if(isset($geodir_post_types[$post->post_type]['labels']['name'])){
4048
-                $plural_name = __($geodir_post_types[$post->post_type]['labels']['name'],'geodirectory');
4047
+            if (isset($geodir_post_types[$post->post_type]['labels']['name'])) {
4048
+                $plural_name = __($geodir_post_types[$post->post_type]['labels']['name'], 'geodirectory');
4049 4049
             }
4050 4050
 
4051 4051
         }
4052
-        $title = str_replace("%%pt_plural%%",$plural_name,$title);
4052
+        $title = str_replace("%%pt_plural%%", $plural_name, $title);
4053 4053
     }
4054 4054
 
4055 4055
 
4056 4056
 
4057
-    if(strpos($title,'%%category%%') !== false){
4057
+    if (strpos($title, '%%category%%') !== false) {
4058 4058
         $cat_name = '';
4059 4059
 
4060
-        if($gd_page=='detail') {
4060
+        if ($gd_page == 'detail') {
4061 4061
             if ($post->default_category) {
4062 4062
                 $cat = get_term($post->default_category, $post->post_type . 'category');
4063 4063
                 $cat_name = (isset($cat->name)) ? $cat->name : '';
4064 4064
             }
4065
-        }elseif($gd_page=='listing'){
4065
+        }elseif ($gd_page == 'listing') {
4066 4066
             $queried_object = get_queried_object();
4067
-            if(isset($queried_object->name)){
4067
+            if (isset($queried_object->name)) {
4068 4068
                 $cat_name = $queried_object->name;
4069 4069
             }
4070 4070
         }
4071
-        $title = str_replace("%%category%%",$cat_name,$title);
4071
+        $title = str_replace("%%category%%", $cat_name, $title);
4072 4072
     }
4073 4073
 
4074
-    if(strpos($title,'%%tag%%') !== false){
4074
+    if (strpos($title, '%%tag%%') !== false) {
4075 4075
         $cat_name = '';
4076 4076
 
4077
-        if($gd_page=='detail') {
4077
+        if ($gd_page == 'detail') {
4078 4078
             if ($post->default_category) {
4079 4079
                 $cat = get_term($post->default_category, $post->post_type . 'category');
4080 4080
                 $cat_name = (isset($cat->name)) ? $cat->name : '';
4081 4081
             }
4082
-        }elseif($gd_page=='listing'){
4082
+        }elseif ($gd_page == 'listing') {
4083 4083
             $queried_object = get_queried_object();
4084
-            if(isset($queried_object->name)){
4084
+            if (isset($queried_object->name)) {
4085 4085
                 $cat_name = $queried_object->name;
4086 4086
             }
4087 4087
         }
4088
-        $title = str_replace("%%tag%%",$cat_name,$title);
4088
+        $title = str_replace("%%tag%%", $cat_name, $title);
4089 4089
     }
4090 4090
 
4091 4091
 
4092 4092
 
4093
-    if(strpos($title,'%%id%%') !== false){
4093
+    if (strpos($title, '%%id%%') !== false) {
4094 4094
         $ID = (isset($post->ID)) ? $post->ID : '';
4095
-        $title = str_replace("%%id%%",$ID,$title);
4095
+        $title = str_replace("%%id%%", $ID, $title);
4096 4096
     }
4097 4097
 
4098 4098
     /*
@@ -4105,8 +4105,8 @@  discard block
 block discarded – undo
4105 4105
         }
4106 4106
     */
4107 4107
 
4108
-    if(strpos($title,'%%sep%%') !== false){
4109
-        $title = str_replace("%%sep%%",$sep,$title);
4108
+    if (strpos($title, '%%sep%%') !== false) {
4109
+        $title = str_replace("%%sep%%", $sep, $title);
4110 4110
     }
4111 4111
 
4112 4112
 
@@ -4124,12 +4124,12 @@  discard block
 block discarded – undo
4124 4124
      * @param string $gd_page The page being filtered.
4125 4125
      * @param string $sep The separator, default: `|`.
4126 4126
      */
4127
-    $location_array = apply_filters('geodir_filter_title_variables_location_arr',$location_array,$title, $gd_page, $sep);
4127
+    $location_array = apply_filters('geodir_filter_title_variables_location_arr', $location_array, $title, $gd_page, $sep);
4128 4128
     $location_titles = array();
4129
-    if($gd_page=='location' && get_query_var( 'gd_country_full' )){
4130
-        if(get_query_var( 'gd_country_full' )){$location_array['gd_country'] = get_query_var( 'gd_country_full' );}
4131
-        if(get_query_var( 'gd_region_full' )){$location_array['gd_region'] = get_query_var( 'gd_region_full' );}
4132
-        if(get_query_var( 'gd_city_full' )){$location_array['gd_city'] = get_query_var( 'gd_city_full' );}
4129
+    if ($gd_page == 'location' && get_query_var('gd_country_full')) {
4130
+        if (get_query_var('gd_country_full')) {$location_array['gd_country'] = get_query_var('gd_country_full'); }
4131
+        if (get_query_var('gd_region_full')) {$location_array['gd_region'] = get_query_var('gd_region_full'); }
4132
+        if (get_query_var('gd_city_full')) {$location_array['gd_city'] = get_query_var('gd_city_full'); }
4133 4133
     }
4134 4134
     $location_single = '';
4135 4135
     $gd_country = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : '';
@@ -4201,65 +4201,65 @@  discard block
 block discarded – undo
4201 4201
     }
4202 4202
 
4203 4203
 
4204
-    if(strpos($title,'%%location%%') !== false){
4204
+    if (strpos($title, '%%location%%') !== false) {
4205 4205
         $location = '';
4206
-        if($location_titles) {
4206
+        if ($location_titles) {
4207 4207
             $location = implode(", ", $location_titles);
4208 4208
         }
4209
-        $title = str_replace("%%location%%",$location,$title);
4209
+        $title = str_replace("%%location%%", $location, $title);
4210 4210
     }
4211 4211
 
4212
-    if(strpos($title,'%%in_location%%') !== false){
4212
+    if (strpos($title, '%%in_location%%') !== false) {
4213 4213
         $location = '';
4214
-        if($location_titles) {
4214
+        if ($location_titles) {
4215 4215
             $location = __('in ', 'geodirectory') . implode(", ", $location_titles);
4216 4216
         }
4217
-        $title = str_replace("%%in_location%%",$location,$title);
4217
+        $title = str_replace("%%in_location%%", $location, $title);
4218 4218
     }
4219 4219
 
4220
-    if(strpos($title,'%%in_location_single%%') !== false){
4221
-        if($location_single) {
4222
-            $location_single = __('in', 'geodirectory') . ' ' .$location_single;
4220
+    if (strpos($title, '%%in_location_single%%') !== false) {
4221
+        if ($location_single) {
4222
+            $location_single = __('in', 'geodirectory') . ' ' . $location_single;
4223 4223
         }
4224
-        $title = str_replace("%%in_location_single%%",$location_single,$title);
4224
+        $title = str_replace("%%in_location_single%%", $location_single, $title);
4225 4225
     }
4226 4226
 
4227
-    if(strpos($title,'%%location_single%%') !== false){
4228
-        $title = str_replace("%%location_single%%",$location_single,$title);
4227
+    if (strpos($title, '%%location_single%%') !== false) {
4228
+        $title = str_replace("%%location_single%%", $location_single, $title);
4229 4229
     }
4230 4230
 
4231 4231
 
4232
-    if(strpos($title,'%%search_term%%') !== false){
4232
+    if (strpos($title, '%%search_term%%') !== false) {
4233 4233
         $search_term = '';
4234
-        if(isset($_REQUEST['s'])){
4234
+        if (isset($_REQUEST['s'])) {
4235 4235
             $search_term = esc_attr($_REQUEST['s']);
4236 4236
         }
4237
-        $title = str_replace("%%search_term%%",$search_term,$title);
4237
+        $title = str_replace("%%search_term%%", $search_term, $title);
4238 4238
     }
4239 4239
 
4240
-    if(strpos($title,'%%search_near%%') !== false){
4240
+    if (strpos($title, '%%search_near%%') !== false) {
4241 4241
         $search_term = '';
4242
-        if(isset($_REQUEST['snear'])){
4242
+        if (isset($_REQUEST['snear'])) {
4243 4243
             $search_term = esc_attr($_REQUEST['snear']);
4244 4244
         }
4245
-        $title = str_replace("%%search_near%%",$search_term,$title);
4245
+        $title = str_replace("%%search_near%%", $search_term, $title);
4246 4246
     }
4247 4247
 
4248
-    if(strpos($title,'%%name%%') !== false){
4248
+    if (strpos($title, '%%name%%') !== false) {
4249 4249
         $author_name = '';
4250
-        if($author_name = get_the_author()){}
4251
-        else{
4250
+        if ($author_name = get_the_author()) {}
4251
+        else {
4252 4252
             $queried_object = get_queried_object();
4253
-            if(isset($queried_object->data->user_nicename)){
4253
+            if (isset($queried_object->data->user_nicename)) {
4254 4254
                 $author_name = $queried_object->data->user_nicename;
4255 4255
             }
4256 4256
         }
4257
-        $title = str_replace("%%name%%",$author_name,$title);
4257
+        $title = str_replace("%%name%%", $author_name, $title);
4258 4258
     }
4259 4259
 
4260
-    $title = wptexturize( $title );
4261
-    $title = convert_chars( $title );
4262
-    $title = esc_html( $title );
4260
+    $title = wptexturize($title);
4261
+    $title = convert_chars($title);
4262
+    $title = esc_html($title);
4263 4263
 
4264 4264
     /**
4265 4265
      * Filter the title variables after standard ones have been filtered.
@@ -4272,7 +4272,7 @@  discard block
 block discarded – undo
4272 4272
      * @param string $sep The separator, default: `|`.
4273 4273
      */
4274 4274
 
4275
-    return apply_filters('geodir_filter_title_variables_vars',$title,$location_array, $gd_page, $sep);
4275
+    return apply_filters('geodir_filter_title_variables_vars', $title, $location_array, $gd_page, $sep);
4276 4276
 }
4277 4277
 
4278 4278
 /**
Please login to merge, or discard this patch.
geodirectory-functions/helper_functions.php 1 patch
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -13,11 +13,11 @@  discard block
 block discarded – undo
13 13
  * @since 1.4.6
14 14
  * @return int|null Return the page ID if present or null if not.
15 15
  */
16
-function geodir_add_listing_page_id(){
16
+function geodir_add_listing_page_id() {
17 17
     $gd_page_id = get_option('geodir_add_listing_page');
18 18
 
19 19
     if (function_exists('icl_object_id')) {
20
-        $gd_page_id =  icl_object_id($gd_page_id, 'page', true);
20
+        $gd_page_id = icl_object_id($gd_page_id, 'page', true);
21 21
     }
22 22
 
23 23
     return $gd_page_id;
@@ -30,11 +30,11 @@  discard block
 block discarded – undo
30 30
  * @since 1.4.6
31 31
  * @return int|null Return the page ID if present or null if not.
32 32
  */
33
-function geodir_preview_page_id(){
33
+function geodir_preview_page_id() {
34 34
     $gd_page_id = get_option('geodir_preview_page');
35 35
 
36 36
     if (function_exists('icl_object_id')) {
37
-        $gd_page_id =  icl_object_id($gd_page_id, 'page', true);
37
+        $gd_page_id = icl_object_id($gd_page_id, 'page', true);
38 38
     }
39 39
 
40 40
     return $gd_page_id;
@@ -47,11 +47,11 @@  discard block
 block discarded – undo
47 47
  * @since 1.4.6
48 48
  * @return int|null Return the page ID if present or null if not.
49 49
  */
50
-function geodir_success_page_id(){
50
+function geodir_success_page_id() {
51 51
     $gd_page_id = get_option('geodir_success_page');
52 52
 
53 53
     if (function_exists('icl_object_id')) {
54
-        $gd_page_id =  icl_object_id($gd_page_id, 'page', true);
54
+        $gd_page_id = icl_object_id($gd_page_id, 'page', true);
55 55
     }
56 56
 
57 57
     return $gd_page_id;
@@ -64,11 +64,11 @@  discard block
 block discarded – undo
64 64
  * @since 1.4.6
65 65
  * @return int|null Return the page ID if present or null if not.
66 66
  */
67
-function geodir_location_page_id(){
67
+function geodir_location_page_id() {
68 68
     $gd_page_id = get_option('geodir_location_page');
69 69
 
70 70
     if (function_exists('icl_object_id')) {
71
-        $gd_page_id =  icl_object_id($gd_page_id, 'page', true);
71
+        $gd_page_id = icl_object_id($gd_page_id, 'page', true);
72 72
     }
73 73
 
74 74
     return $gd_page_id;
@@ -81,11 +81,11 @@  discard block
 block discarded – undo
81 81
  * @since 1.5.4
82 82
  * @return int|null Return the page ID if present or null if not.
83 83
  */
84
-function geodir_home_page_id(){
84
+function geodir_home_page_id() {
85 85
     $gd_page_id = get_option('geodir_home_page');
86 86
 
87 87
     if (function_exists('icl_object_id')) {
88
-        $gd_page_id =  icl_object_id($gd_page_id, 'page', true);
88
+        $gd_page_id = icl_object_id($gd_page_id, 'page', true);
89 89
     }
90 90
 
91 91
     return $gd_page_id;
@@ -98,11 +98,11 @@  discard block
 block discarded – undo
98 98
  * @since 1.5.3
99 99
  * @return int|null Return the page ID if present or null if not.
100 100
  */
101
-function geodir_info_page_id(){
101
+function geodir_info_page_id() {
102 102
     $gd_page_id = get_option('geodir_info_page');
103 103
 
104 104
     if (function_exists('icl_object_id')) {
105
-        $gd_page_id =  icl_object_id($gd_page_id, 'page', true);
105
+        $gd_page_id = icl_object_id($gd_page_id, 'page', true);
106 106
     }
107 107
 
108 108
     return $gd_page_id;
@@ -115,11 +115,11 @@  discard block
 block discarded – undo
115 115
  * @since 1.5.3
116 116
  * @return int|null Return the page ID if present or null if not.
117 117
  */
118
-function geodir_login_page_id(){
118
+function geodir_login_page_id() {
119 119
     $gd_page_id = get_option('geodir_login_page');
120 120
 
121 121
     if (function_exists('icl_object_id')) {
122
-        $gd_page_id =  icl_object_id($gd_page_id, 'page', true);
122
+        $gd_page_id = icl_object_id($gd_page_id, 'page', true);
123 123
     }
124 124
 
125 125
     return $gd_page_id;
@@ -133,11 +133,11 @@  discard block
 block discarded – undo
133 133
  * @since 1.5.3
134 134
  * @return int|null Return the page ID if present or null if not.
135 135
  */
136
-function geodir_login_url($args=array()){
136
+function geodir_login_url($args = array()) {
137 137
     $gd_page_id = get_option('geodir_login_page');
138 138
 
139 139
     if (function_exists('icl_object_id')) {
140
-        $gd_page_id =  icl_object_id($gd_page_id, 'page', true);
140
+        $gd_page_id = icl_object_id($gd_page_id, 'page', true);
141 141
     }
142 142
 
143 143
     if (function_exists('geodir_location_geo_home_link')) {
@@ -148,17 +148,17 @@  discard block
 block discarded – undo
148 148
         add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2);
149 149
     }
150 150
 
151
-    if($gd_page_id){
151
+    if ($gd_page_id) {
152 152
         $post = get_post($gd_page_id);
153 153
         $slug = $post->post_name;
154 154
         //$login_url = get_permalink($gd_page_id );// get_permalink can only be user after theme-Setup hook, any earlier and it errors
155
-        $login_url = trailingslashit($home_url)."$slug/";
156
-    }else{
157
-        $login_url = trailingslashit($home_url)."?geodir_signup=true";
155
+        $login_url = trailingslashit($home_url) . "$slug/";
156
+    } else {
157
+        $login_url = trailingslashit($home_url) . "?geodir_signup=true";
158 158
     }
159 159
 
160
-    if($args){
161
-        $login_url = add_query_arg($args,$login_url );
160
+    if ($args) {
161
+        $login_url = add_query_arg($args, $login_url);
162 162
     }
163 163
 
164 164
     /**
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
      * @param array $args The array of query args used.
173 173
      * @param int $gd_page_id The page id of the GD login page.
174 174
      */
175
-    return apply_filters('geodir_login_url',$login_url,$args,$gd_page_id);
175
+    return apply_filters('geodir_login_url', $login_url, $args, $gd_page_id);
176 176
 }
177 177
 
178 178
 /**
@@ -182,11 +182,11 @@  discard block
 block discarded – undo
182 182
  * @since 1.5.4
183 183
  * @return string Info page url.
184 184
  */
185
-function geodir_info_url($args=array()){
185
+function geodir_info_url($args = array()) {
186 186
     $gd_page_id = get_option('geodir_info_page');
187 187
 
188 188
     if (function_exists('icl_object_id')) {
189
-        $gd_page_id =  icl_object_id($gd_page_id, 'page', true);
189
+        $gd_page_id = icl_object_id($gd_page_id, 'page', true);
190 190
     }
191 191
 
192 192
     if (function_exists('geodir_location_geo_home_link')) {
@@ -197,17 +197,17 @@  discard block
 block discarded – undo
197 197
         add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2);
198 198
     }
199 199
 
200
-    if($gd_page_id){
200
+    if ($gd_page_id) {
201 201
         $post = get_post($gd_page_id);
202 202
         $slug = $post->post_name;
203 203
         //$login_url = get_permalink($gd_page_id );// get_permalink can only be user after theme-Setup hook, any earlier and it errors
204
-        $info_url = trailingslashit($home_url)."$slug/";
205
-    }else{
204
+        $info_url = trailingslashit($home_url) . "$slug/";
205
+    } else {
206 206
         $info_url = trailingslashit($home_url);
207 207
     }
208 208
 
209
-    if($args){
210
-        $info_url = add_query_arg($args,$info_url );
209
+    if ($args) {
210
+        $info_url = add_query_arg($args, $info_url);
211 211
     }
212 212
 
213 213
     return $info_url;
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
  * @param string $charset Character set to use for conversion.
226 226
  * @return string Returns converted string.
227 227
  */
228
-function geodir_ucwords($string, $charset='UTF-8') {
228
+function geodir_ucwords($string, $charset = 'UTF-8') {
229 229
     if (function_exists('mb_convert_case')) {
230 230
         return mb_convert_case($string, MB_CASE_TITLE, $charset);
231 231
     } else {
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
  * @param string $charset Character set to use for conversion.
246 246
  * @return string Returns converted string.
247 247
  */
248
-function geodir_strtolower($string, $charset='UTF-8') {
248
+function geodir_strtolower($string, $charset = 'UTF-8') {
249 249
     if (function_exists('mb_convert_case')) {
250 250
         return mb_convert_case($string, MB_CASE_LOWER, $charset);
251 251
     } else {
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
  * @param string $charset Character set to use for conversion.
266 266
  * @return string Returns converted string.
267 267
  */
268
-function geodir_strtoupper($string, $charset='UTF-8') {
268
+function geodir_strtoupper($string, $charset = 'UTF-8') {
269 269
     if (function_exists('mb_convert_case')) {
270 270
         return mb_convert_case($string, MB_CASE_UPPER, $charset);
271 271
     } else {
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
 	
297 297
 	$url = trim($parts[0]);
298 298
 	if ($formatted && $url != '') {
299
-		$url = str_replace( ' ', '%20', $url );
299
+		$url = str_replace(' ', '%20', $url);
300 300
 		$url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:%@$\|*\'()\[\]\\x80-\\xff]|i', '', $url);
301 301
 		
302 302
 		if (0 !== stripos($url, 'mailto:')) {
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
 		
307 307
 		$url = str_replace(';//', '://', $url);
308 308
 		
309
-		if (strpos($url, ':') === false && ! in_array($url[0], array('/', '#', '?')) && !preg_match('/^[a-z0-9-]+?\.php/i', $url)) {
309
+		if (strpos($url, ':') === false && !in_array($url[0], array('/', '#', '?')) && !preg_match('/^[a-z0-9-]+?\.php/i', $url)) {
310 310
 			$url = 'http://' . $url;
311 311
 		}
312 312
 		
@@ -449,7 +449,7 @@  discard block
 block discarded – undo
449 449
  * @package GeoDirectory
450 450
  */
451 451
 function _gd_die_handler() {
452
-    if ( defined( 'GD_TESTING_MODE' ) ) {
452
+    if (defined('GD_TESTING_MODE')) {
453 453
         return '_gd_die_handler';
454 454
     } else {
455 455
         die();
@@ -467,8 +467,8 @@  discard block
 block discarded – undo
467 467
  * @param string $title   Optional. Error title.
468 468
  * @param int $status     Optional. Status code.
469 469
  */
470
-function gd_die( $message = '', $title = '', $status = 400 ) {
471
-    add_filter( 'wp_die_ajax_handler', '_gd_die_handler', 10, 3 );
472
-    add_filter( 'wp_die_handler', '_gd_die_handler', 10, 3 );
473
-    wp_die( $message, $title, array( 'response' => $status ));
470
+function gd_die($message = '', $title = '', $status = 400) {
471
+    add_filter('wp_die_ajax_handler', '_gd_die_handler', 10, 3);
472
+    add_filter('wp_die_handler', '_gd_die_handler', 10, 3);
473
+    wp_die($message, $title, array('response' => $status));
474 474
 }
475 475
\ No newline at end of file
Please login to merge, or discard this patch.
tests/test-Check_Maps.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -9,13 +9,13 @@  discard block
 block discarded – undo
9 9
     public function testCheckHomeMap()
10 10
     {
11 11
         $output = do_shortcode('[gd_homepage_map width=100% height=300 scrollwheel=false]');
12
-        $this->assertContains( 'geodir-map-home-page', $output );
12
+        $this->assertContains('geodir-map-home-page', $output);
13 13
     }
14 14
 
15 15
     public function testListingsPageMap()
16 16
     {
17 17
         $output = do_shortcode('[gd_listing_map width=100% height=300 scrollwheel=false sticky=true]');
18
-        $this->assertContains( 'geodir-map-listing-page', $output );
18
+        $this->assertContains('geodir-map-listing-page', $output);
19 19
     }
20 20
 
21 21
     public function testDetailPageMap()
@@ -27,12 +27,12 @@  discard block
 block discarded – undo
27 27
             'posts_per_page' => 1,
28 28
         );
29 29
 
30
-        $all_posts = new WP_Query( $query_args );
30
+        $all_posts = new WP_Query($query_args);
31 31
         $post_id = null;
32
-        while ( $all_posts->have_posts() ) : $all_posts->the_post();
32
+        while ($all_posts->have_posts()) : $all_posts->the_post();
33 33
             $post_id = get_the_ID();
34 34
             global $post;
35
-            $post =  geodir_get_post_info($post_id);
35
+            $post = geodir_get_post_info($post_id);
36 36
             setup_postdata($post);
37 37
 
38 38
             $map_args = array();
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
             ob_start();
56 56
             geodir_draw_map($map_args);
57 57
             $output = ob_get_clean();
58
-            $this->assertContains( 'geodir-map-detail-page', $output );
58
+            $this->assertContains('geodir-map-detail-page', $output);
59 59
         endwhile;
60 60
 
61 61
 
Please login to merge, or discard this patch.
tests/test-Favourites.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -17,9 +17,9 @@  discard block
 block discarded – undo
17 17
             'posts_per_page' => 1,
18 18
         );
19 19
 
20
-        $all_posts = new WP_Query( $query_args );
20
+        $all_posts = new WP_Query($query_args);
21 21
         $post_id = null;
22
-        while ( $all_posts->have_posts() ) : $all_posts->the_post();
22
+        while ($all_posts->have_posts()) : $all_posts->the_post();
23 23
             $post_id = get_the_ID();
24 24
         endwhile;
25 25
 
@@ -28,13 +28,13 @@  discard block
 block discarded – undo
28 28
         ob_start();
29 29
         geodir_add_to_favorite($post_id);
30 30
         $output = ob_get_clean();
31
-        $this->assertContains( 'Remove from Favorites', $output );
31
+        $this->assertContains('Remove from Favorites', $output);
32 32
 
33 33
         $user_id = $current_user->ID;
34 34
 
35 35
         $user_fav_posts = get_user_meta($user_id, 'gd_user_favourite_post', true);
36 36
 
37
-        $this->assertContains( $post_id, $user_fav_posts );
37
+        $this->assertContains($post_id, $user_fav_posts);
38 38
 
39 39
 
40 40
     }
@@ -49,9 +49,9 @@  discard block
 block discarded – undo
49 49
             'posts_per_page' => 1,
50 50
         );
51 51
 
52
-        $all_posts = new WP_Query( $query_args );
52
+        $all_posts = new WP_Query($query_args);
53 53
         $post_id = null;
54
-        while ( $all_posts->have_posts() ) : $all_posts->the_post();
54
+        while ($all_posts->have_posts()) : $all_posts->the_post();
55 55
             $post_id = get_the_ID();
56 56
         endwhile;
57 57
 
@@ -60,22 +60,22 @@  discard block
 block discarded – undo
60 60
         ob_start();
61 61
         geodir_add_to_favorite($post_id);
62 62
         $output = ob_get_clean();
63
-        $this->assertContains( 'Remove from Favorites', $output );
63
+        $this->assertContains('Remove from Favorites', $output);
64 64
 
65 65
         $user_id = $current_user->ID;
66 66
 
67 67
         $user_fav_posts = get_user_meta($user_id, 'gd_user_favourite_post', true);
68 68
 
69
-        $this->assertContains( $post_id, $user_fav_posts );
69
+        $this->assertContains($post_id, $user_fav_posts);
70 70
 
71 71
         ob_start();
72 72
         geodir_remove_from_favorite($post_id);
73 73
         $output = ob_get_clean();
74
-        $this->assertContains( 'Add to Favorites', $output );
74
+        $this->assertContains('Add to Favorites', $output);
75 75
 
76 76
         $user_fav_posts = get_user_meta($user_id, 'gd_user_favourite_post', true);
77 77
 
78
-        $this->assertNotContains( $post_id, $user_fav_posts );
78
+        $this->assertNotContains($post_id, $user_fav_posts);
79 79
     }
80 80
 
81 81
 
Please login to merge, or discard this patch.
tests/test-Send_Enquiry.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -14,9 +14,9 @@  discard block
 block discarded – undo
14 14
             'posts_per_page' => 1,
15 15
         );
16 16
 
17
-        $all_posts = new WP_Query( $query_args );
17
+        $all_posts = new WP_Query($query_args);
18 18
         $post_id = null;
19
-        while ( $all_posts->have_posts() ) : $all_posts->the_post();
19
+        while ($all_posts->have_posts()) : $all_posts->the_post();
20 20
             $post_id = get_the_ID();
21 21
         endwhile;
22 22
 
@@ -45,9 +45,9 @@  discard block
 block discarded – undo
45 45
             'posts_per_page' => 1,
46 46
         );
47 47
 
48
-        $all_posts = new WP_Query( $query_args );
48
+        $all_posts = new WP_Query($query_args);
49 49
         $post_id = null;
50
-        while ( $all_posts->have_posts() ) : $all_posts->the_post();
50
+        while ($all_posts->have_posts()) : $all_posts->the_post();
51 51
             $post_id = get_the_ID();
52 52
         endwhile;
53 53
 
@@ -78,9 +78,9 @@  discard block
 block discarded – undo
78 78
             'posts_per_page' => 1,
79 79
         );
80 80
 
81
-        $all_posts = new WP_Query( $query_args );
81
+        $all_posts = new WP_Query($query_args);
82 82
         $post_id = null;
83
-        while ( $all_posts->have_posts() ) : $all_posts->the_post();
83
+        while ($all_posts->have_posts()) : $all_posts->the_post();
84 84
             $post_id = get_the_ID();
85 85
         endwhile;
86 86
 
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
         ob_start();
104 104
         geodir_send_friend($data);
105 105
         $output = ob_get_clean();
106
-        $this->assertContains( 'Email from GeoDirectory failed to send', $output );
106
+        $this->assertContains('Email from GeoDirectory failed to send', $output);
107 107
         remove_filter('wp_mail', 'print_mail');
108 108
         remove_filter('wp_redirect', '__return_false');
109 109
     }
Please login to merge, or discard this patch.
tests/bootstrap.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -3,41 +3,41 @@  discard block
 block discarded – undo
3 3
 $_SERVER['SERVER_NAME'] = '';
4 4
 $PHP_SELF = $GLOBALS['PHP_SELF'] = $_SERVER['PHP_SELF'] = '/index.php';
5 5
 
6
-define( 'GD_USE_PHP_SESSIONS', false );
7
-define( 'GD_TESTING_MODE', true );
6
+define('GD_USE_PHP_SESSIONS', false);
7
+define('GD_TESTING_MODE', true);
8 8
 
9
-$_tests_dir = getenv( 'WP_TESTS_DIR' );
9
+$_tests_dir = getenv('WP_TESTS_DIR');
10 10
 
11
-if ( ! $_tests_dir ) {
12
-	$_tests_dir = dirname( __FILE__ )  . '/lib/wordpress-tests-lib';
11
+if (!$_tests_dir) {
12
+	$_tests_dir = dirname(__FILE__) . '/lib/wordpress-tests-lib';
13 13
 }
14 14
 
15 15
 require_once $_tests_dir . '/includes/functions.php';
16 16
 
17 17
 function _manually_load_plugin() {
18
-	require dirname( __FILE__ ) . '/../geodirectory.php';
18
+	require dirname(__FILE__) . '/../geodirectory.php';
19 19
 }
20
-tests_add_filter( 'muplugins_loaded', '_manually_load_plugin' );
20
+tests_add_filter('muplugins_loaded', '_manually_load_plugin');
21 21
 
22 22
 function place_dummy_image_url($url) {
23
-	$gd_dummy_base_url = getenv( 'GD_DUMMY_BASE_URL' );
23
+	$gd_dummy_base_url = getenv('GD_DUMMY_BASE_URL');
24 24
 	if ($gd_dummy_base_url) {
25 25
 		return $gd_dummy_base_url;
26 26
 	} else {
27 27
 		return $url;
28 28
 	}
29 29
 }
30
-tests_add_filter( 'place_dummy_image_url', 'place_dummy_image_url' );
30
+tests_add_filter('place_dummy_image_url', 'place_dummy_image_url');
31 31
 
32 32
 function place_dummy_cat_image_url($url) {
33
-	$gd_dummy_base_url = getenv( 'GD_DUMMY_BASE_URL' );
33
+	$gd_dummy_base_url = getenv('GD_DUMMY_BASE_URL');
34 34
 	if ($gd_dummy_base_url) {
35
-		return $gd_dummy_base_url."/cat_icon";
35
+		return $gd_dummy_base_url . "/cat_icon";
36 36
 	} else {
37 37
 		return $url;
38 38
 	}
39 39
 }
40
-tests_add_filter( 'place_dummy_cat_image_url', 'place_dummy_cat_image_url' );
40
+tests_add_filter('place_dummy_cat_image_url', 'place_dummy_cat_image_url');
41 41
 
42 42
 
43 43
 require $_tests_dir . '/includes/bootstrap.php';
@@ -45,12 +45,12 @@  discard block
 block discarded – undo
45 45
 global $current_user;
46 46
 $current_user = new WP_User(1);
47 47
 $current_user->set_role('administrator');
48
-wp_update_user( array( 'ID' => 1, 'first_name' => 'Admin', 'last_name' => 'User' ) );
48
+wp_update_user(array('ID' => 1, 'first_name' => 'Admin', 'last_name' => 'User'));
49 49
 //Add subscriber
50
-wp_create_user( 'testuser', '12345', '[email protected]' );
50
+wp_create_user('testuser', '12345', '[email protected]');
51 51
 
52 52
 echo "Activating GeoDirectory...\n";
53
-activate_plugin( 'geodirectory/geodirectory.php' );
53
+activate_plugin('geodirectory/geodirectory.php');
54 54
 
55 55
 echo "Installing GeoDirectory...\n";
56 56
 geodir_install();
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 //	unset($_REQUEST['_wpnonce']);
122 122
 
123 123
 	$i = 2;
124
-	while($i <= $max) {
124
+	while ($i <= $max) {
125 125
 		global $dummy_post_index, $city_bound_lat1, $city_bound_lng1, $city_bound_lat2, $city_bound_lng2;
126 126
 
127 127
 		$dummy_post_index = $i;
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 		$city_bound_lat2 = 40.91525559999999;
131 131
 		$city_bound_lng2 = -73.7002721;
132 132
 
133
-		include dirname( __FILE__ ) . '/../geodirectory-admin/place_dummy_post.php';
133
+		include dirname(__FILE__) . '/../geodirectory-admin/place_dummy_post.php';
134 134
 		$i++;
135 135
 	}
136 136
 }
Please login to merge, or discard this patch.
tests/lib/wordpress-tests-lib/wp-tests-config.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 /* Path to the WordPress codebase you'd like to test. Add a backslash in the end. */
4
-define( 'ABSPATH', getenv( 'WP_CORE_DIR' ) . '/' );
4
+define('ABSPATH', getenv('WP_CORE_DIR') . '/');
5 5
 
6 6
 // Test with multisite enabled
7
-define( 'WP_TESTS_MULTISITE', (bool) getenv( 'WP_MULTISITE' ) );
7
+define('WP_TESTS_MULTISITE', (bool) getenv('WP_MULTISITE'));
8 8
 
9 9
 // Force known bugs
10 10
 // define( 'WP_TESTS_FORCE_KNOWN_BUGS', true );
11 11
 
12 12
 // Test with WordPress debug mode on
13
-define( 'WP_DEBUG', true );
13
+define('WP_DEBUG', true);
14 14
 
15 15
 // ** MySQL settings ** //
16 16
 
@@ -21,18 +21,18 @@  discard block
 block discarded – undo
21 21
 // These tests will DROP ALL TABLES in the database with the prefix named below.
22 22
 // DO NOT use a production database or one that is shared with something else.
23 23
 
24
-define( 'DB_NAME', 'wordpress_test' );
25
-define( 'DB_USER', 'root' );
26
-define( 'DB_PASSWORD', 'root' );
27
-define( 'DB_HOST', 'localhost' );
28
-define( 'DB_CHARSET', 'utf8' );
29
-define( 'DB_COLLATE', '' );
24
+define('DB_NAME', 'wordpress_test');
25
+define('DB_USER', 'root');
26
+define('DB_PASSWORD', 'root');
27
+define('DB_HOST', 'localhost');
28
+define('DB_CHARSET', 'utf8');
29
+define('DB_COLLATE', '');
30 30
 
31
-define( 'WP_TESTS_DOMAIN', 'example.org' );
32
-define( 'WP_TESTS_EMAIL', '[email protected]' );
33
-define( 'WP_TESTS_TITLE', 'Test Blog' );
31
+define('WP_TESTS_DOMAIN', 'example.org');
32
+define('WP_TESTS_EMAIL', '[email protected]');
33
+define('WP_TESTS_TITLE', 'Test Blog');
34 34
 
35
-define( 'WP_PHP_BINARY', 'php' );
35
+define('WP_PHP_BINARY', 'php');
36 36
 
37
-define( 'WPLANG', '' );
38
-$table_prefix  = 'wptests_';
39 37
\ No newline at end of file
38
+define('WPLANG', '');
39
+$table_prefix = 'wptests_';
40 40
\ No newline at end of file
Please login to merge, or discard this patch.
tests/lib/wordpress-tests-lib/includes/wp-profiler.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 		// reset the wpdb queries log, storing it on the profile stack if necessary
41 41
 		global $wpdb;
42 42
 		if ($this->stack) {
43
-			$this->stack[count($this->stack)-1]['queries'] = $wpdb->queries;
43
+			$this->stack[count($this->stack) - 1]['queries'] = $wpdb->queries;
44 44
 		}
45 45
 		$wpdb->queries = array();
46 46
 
@@ -74,14 +74,14 @@  discard block
 block discarded – undo
74 74
 
75 75
 		if (isset($this->profile[$name])) {
76 76
 			$this->profile[$name]['time'] += $time;
77
-			$this->profile[$name]['calls'] ++;
77
+			$this->profile[$name]['calls']++;
78 78
 			$this->profile[$name]['cache_cold_hits'] += ($wp_object_cache->cold_cache_hits - $item['cache_cold_hits']);
79 79
 			$this->profile[$name]['cache_warm_hits'] += ($wp_object_cache->warm_cache_hits - $item['cache_warm_hits']);
80 80
 			$this->profile[$name]['cache_misses'] += ($wp_object_cache->cache_misses - $item['cache_misses']);
81
-			$this->profile[$name]['cache_dirty_objects'] = array_add( $this->profile[$name]['cache_dirty_objects'], $cache_dirty_delta) ;
82
-			$this->profile[$name]['actions'] = array_add( $this->profile[$name]['actions'], $item['actions'] );
83
-			$this->profile[$name]['filters'] = array_add( $this->profile[$name]['filters'], $item['filters'] );
84
-			$this->profile[$name]['queries'] = array_add( $this->profile[$name]['queries'], $item['queries'] );
81
+			$this->profile[$name]['cache_dirty_objects'] = array_add($this->profile[$name]['cache_dirty_objects'], $cache_dirty_delta);
82
+			$this->profile[$name]['actions'] = array_add($this->profile[$name]['actions'], $item['actions']);
83
+			$this->profile[$name]['filters'] = array_add($this->profile[$name]['filters'], $item['filters']);
84
+			$this->profile[$name]['queries'] = array_add($this->profile[$name]['queries'], $item['queries']);
85 85
 			#$this->_query_summary($item['queries'], $this->profile[$name]['queries']);
86 86
 
87 87
 		}
@@ -109,28 +109,28 @@  discard block
 block discarded – undo
109 109
 
110 110
 	function microtime($since = 0.0) {
111 111
 		list($usec, $sec) = explode(' ', microtime());
112
-		return (float)$sec + (float)$usec - $since;
112
+		return (float) $sec + (float) $usec - $since;
113 113
 	}
114 114
 
115 115
 	function log_filter($tag) {
116 116
 		if ($this->stack) {
117 117
 			global $wp_actions;
118 118
 			if ($tag == end($wp_actions))
119
-				@$this->stack[count($this->stack)-1]['actions'][$tag] ++;
119
+				@$this->stack[count($this->stack) - 1]['actions'][$tag]++;
120 120
 			else
121
-				@$this->stack[count($this->stack)-1]['filters'][$tag] ++;
121
+				@$this->stack[count($this->stack) - 1]['filters'][$tag]++;
122 122
 		}
123 123
 		return $arg;
124 124
 	}
125 125
 
126 126
 	function log_action($tag) {
127 127
 		if ($this->stack)
128
-			@$this->stack[count($this->stack)-1]['actions'][$tag] ++;
128
+			@$this->stack[count($this->stack) - 1]['actions'][$tag]++;
129 129
 	}
130 130
 
131 131
 	function _current_action() {
132 132
 		global $wp_actions;
133
-		return $wp_actions[count($wp_actions)-1];
133
+		return $wp_actions[count($wp_actions) - 1];
134 134
 	}
135 135
 
136 136
 	function results() {
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
 			$sql = preg_replace('/(WHERE \w+ =) \d+/', '$1 x', $sql);
144 144
 			$sql = preg_replace('/(WHERE \w+ =) \'\[-\w]+\'/', '$1 \'xxx\'', $sql);
145 145
 
146
-			@$out[$sql] ++;
146
+			@$out[$sql]++;
147 147
 		}
148 148
 		asort($out);
149 149
 		return;
@@ -154,9 +154,9 @@  discard block
 block discarded – undo
154 154
 		$out = array();
155 155
 		foreach ($queries as $q) {
156 156
 			if (empty($q[2]))
157
-				@$out['unknown'] ++;
157
+				@$out['unknown']++;
158 158
 			else
159
-				@$out[$q[2]] ++;
159
+				@$out[$q[2]]++;
160 160
 		}
161 161
 		return $out;
162 162
 	}
Please login to merge, or discard this patch.