Portfolio Gallery theme + wp-cli

Carlos Pasqualini created the topic: Portfolio Gallery theme + wp-cli

Hi

We use wp-cli for automated upgrading of wordpress sites, but we are having issues with this theme.

~# sudo -u www-data -i -- wp --path=$(pwd) core update

PHP Warning:  Invalid argument supplied for foreach() in /var/www/wp-content/themes/portfolio-gallery/inc/admin/WDWT_admin_controller.php on line 161
Warning: Invalid argument supplied for foreach() in /var/www/wp-content/themes/portfolio-gallery/inc/admin/WDWT_admin_controller.php on line 161
PHP Warning:  Invalid argument supplied for foreach() in /var/www/wp-content/themes/portfolio-gallery/inc/admin/WDWT_admin_controller.php on line 163
Warning: Invalid argument supplied for foreach() in /var/www/wp-content/themes/portfolio-gallery/inc/admin/WDWT_admin_controller.php on line 163
PHP Warning:  Invalid argument supplied for foreach() in /var/www/wp-content/themes/portfolio-gallery/inc/admin/WDWT_admin_controller.php on line 167
Warning: Invalid argument supplied for foreach() in /var/www/wp-content/themes/portfolio-gallery/inc/admin/WDWT_admin_controller.php on line 167
PHP Warning:  Invalid argument supplied for foreach() in /var/www/wp-content/themes/portfolio-gallery/inc/admin/WDWT_admin_controller.php on line 170
Warning: Invalid argument supplied for foreach() in /var/www/wp-content/themes/portfolio-gallery/inc/admin/WDWT_admin_controller.php on line 170
PHP Warning:  Invalid argument supplied for foreach() in /var/www/wp-content/themes/portfolio-gallery/inc/admin/WDWT_admin_controller.php on line 176
Warning: Invalid argument supplied for foreach() in /var/www/wp-content/themes/portfolio-gallery/inc/admin/WDWT_admin_controller.php on line 176
PHP Warning:  Invalid argument supplied for foreach() in /var/www/wp-content/themes/portfolio-gallery/inc/admin/WDWT_admin_controller.php on line 161
Warning: Invalid argument supplied for foreach() in /var/www/wp-content/themes/portfolio-gallery/inc/admin/WDWT_admin_controller.php on line 161
PHP Warning:  Invalid argument supplied for foreach() in /var/www/wp-content/themes/portfolio-gallery/inc/admin/WDWT_admin_controller.php on line 163
Warning: Invalid argument supplied for foreach() in /var/www/wp-content/themes/portfolio-gallery/inc/admin/WDWT_admin_controller.php on line 163
PHP Warning:  Invalid argument supplied for foreach() in /var/www/wp-content/themes/portfolio-gallery/inc/admin/WDWT_admin_controller.php on line 167
Warning: Invalid argument supplied for foreach() in /var/www/wp-content/themes/portfolio-gallery/inc/admin/WDWT_admin_controller.php on line 167
PHP Warning:  Invalid argument supplied for foreach() in /var/www/wp-content/themes/portfolio-gallery/inc/admin/WDWT_admin_controller.php on line 170
Warning: Invalid argument supplied for foreach() in /var/www/wp-content/themes/portfolio-gallery/inc/admin/WDWT_admin_controller.php on line 170
PHP Warning:  Invalid argument supplied for foreach() in /var/www/wp-content/themes/portfolio-gallery/inc/admin/WDWT_admin_controller.php on line 176
Warning: Invalid argument supplied for foreach() in /var/www/wp-content/themes/portfolio-gallery/inc/admin/WDWT_admin_controller.php on line 176
Success: WordPress is up to date.

Reading the code, it seems that when running with wp-cli, things like $wdwt_homepage_page = new WDWT_homepage_page_class(); are not executing as expected.

As a workaround, I had changed the file as in this diff output:
# diff wp-content/themes/portfolio-gallery/inc/admin/WDWT_admin_controller.php wp-content/themes/portfolio-gallery/inc/admin/WDWT_admin_controller.php_orig
161,166c161,164
<   if (isset($wdwt_layout_page)) 
<     foreach($wdwt_layout_page->options as $kay => $x)
<       $options[$kay] = $x;
<   if (isset($wdwt_general_settings_page)) 
<     foreach($wdwt_general_settings_page->options as $kay =>  $x) 
<       $options[$kay] = $x;
---
>   foreach($wdwt_layout_page->options as $kay => $x)
>     $options[$kay] = $x;
>   foreach($wdwt_general_settings_page->options as $kay =>  $x) 
>     $options[$kay] = $x;
169,171c167,168
<   if (isset($wdwt_homepage_page)) 
<     foreach($wdwt_homepage_page->options as $kay =>  $x)  
<       $options[$kay] = $x;
---
>   foreach($wdwt_homepage_page->options as $kay =>  $x)  
>     $options[$kay] = $x;
173,175c170,171
<   if (isset($wdwt_typography_page)) 
<     foreach($wdwt_typography_page->options  as $kay => $x)  
<       $options[$kay] = $x;
---
>   foreach($wdwt_typography_page->options  as $kay => $x)  
>     $options[$kay] = $x;
177,179c173,174
<   if (isset($wdwt_slider_page)) 
<     foreach($wdwt_slider_page->options  as $kay => $x)  
<       $options[$kay] = $x;
---
>   foreach($wdwt_slider_page->options  as $kay => $x)  
>     $options[$kay] = $x;
181,183c176,177
<   if (isset($wdwt_lightbox_page)) 
<     foreach($wdwt_lightbox_page->options  as $kay => $x)  
<       $options[$kay] = $x;
---
>   foreach($wdwt_lightbox_page->options  as $kay => $x)  
>     $options[$kay] = $x;

Now I have no complaints from wp-cli, and seems not to have visible side effects on web access.

It would be better if you review this with your knowledge of the code, and if it is good enough, I would be glad if you can include it on further releases.


Thanks!

#93785

Please Log in or Create an account to join the conversation.


Anoush replied the topic: Portfolio Gallery theme + wp-cli

Hi Carlos,

Thanks for your inquiry :)

I have already informed our development team. They will take a look these points to the upcoming updates of the Theme.

Thanks! Have a great day!

#93813

Please Log in or Create an account to join the conversation.


Time to create page: 0.157 seconds
Powered by Kunena Forum

WORLD-CLASS SUPPORT

We are here for you every step of the way. Turn to our support with any questions you might have about our products and services. Our experienced customer care team is available to help you as fast as we possibly can.

Contact us