10% wp-portfolio

Code Review | Wordpress Portfolio Plugin (WP Portfolio)

WordPress plugin Wordpress Portfolio Plugin (WP Portfolio) scored10%from 54 tests.

About plugin

  • Plugin page: wp-portfolio
  • Plugin version: 1.43.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3.0-4.8
  • WordPress version: 6.3.1
  • First release: May 20, 2009
  • Latest release: Aug 7, 2017
  • Number of updates: 175
  • Update frequency: every 17.2 days
  • Top authors: DanHarrison (53.14%)devdokimov (27.43%)nikitanovikov (14.29%)puravida1976 (6.86%)

Code review

54 tests

User reviews

20 reviews

Install metrics

700+ active /152,862 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
It is recommended to fix the following installer errors
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/wp-portfolio/wplib/utils_pagebuilder.inc.php+25
    Methods with the same name as their class will not be constructors in a future version of PHP; PageBuilder has a deprecated constructor

Server metrics [RAM: ▼1.23MB] [CPU: ▼52.24ms] Passed 4 tests

This is a short check of server-side resources used by Wordpress Portfolio Plugin (WP Portfolio)
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.77 ▼0.706.43 ▼36.75
Dashboard /wp-admin2.79 ▼0.569.58 ▼52.39
Posts /wp-admin/edit.php2.79 ▼0.578.67 ▼37.68
Add New Post /wp-admin/post-new.php2.79 ▼3.107.85 ▼82.15
Media Library /wp-admin/upload.php2.79 ▼0.448.72 ▼25.83
Documentation /wp-admin/admin.php?page=WPP_show_documentation2.797.50
WP Portfolio /wp-admin/admin.php?page=wp-portfolio/wp-portfolio.php2.797.57
Portfolio Settings /wp-admin/admin.php?page=WPP_show_settings2.799.53
Error Logs /wp-admin/admin.php?page=WPP_show_error_page2.797.16
Add New Website /wp-admin/admin.php?page=WPP_modify_website2.799.79
Website Groups /wp-admin/admin.php?page=WPP_website_groups2.798.17
Refresh Thumbnails /wp-admin/admin.php?page=WPP_show_refreshThumbnails2.798.24
Add New Group /wp-admin/admin.php?page=WPP_modify_group2.797.94
Layout Settings /wp-admin/admin.php?page=WPP_show_layout_settings2.797.23

Server storage [IO: ▲1.22MB] [DB: ▲0.01MB] Passed 3 tests

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 66 new files
Database: 6 new tables, 40 new options
New tables
wp_WPPortfolio_websites_meta
wp_WPPortfolio_debuglog
wp_WPPortfolio_groups_websites
wp_WPPortfolio_groups
wp_WPPortfolio_custom_fields
wp_WPPortfolio_websites
New WordPress options
WPPortfolio_setting_stw_render_type
WPPortfolio_setting_stw_thumb_size_custom
WPPortfolio_setting_template_css_paging
db_upgraded
WPPortfolio_setting_lightbox_transition
WPPortfolio_setting_lightbox_speed
widget_theysaidso_widget
WPPortfolio_setting_scale_type
WPPortfolio_setting_stw_thumb_size
WPPortfolio_setting_cache_days
...

Browser metrics Passed 4 tests

Wordpress Portfolio Plugin (WP Portfolio): an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,878 ▲14313.21 ▼1.221.57 ▼0.2941.64 ▼8.04
Dashboard /wp-admin2,273 ▲885.89 ▲0.04101.98 ▼20.6738.67 ▼5.66
Posts /wp-admin/edit.php2,159 ▲702.01 ▲0.0239.39 ▲2.1035.84 ▼0.73
Add New Post /wp-admin/post-new.php1,585 ▲5221.20 ▼2.23682.23 ▲55.7655.40 ▼14.00
Media Library /wp-admin/upload.php1,455 ▲644.23 ▲0.0396.49 ▼1.3242.84 ▼3.96
Documentation /wp-admin/admin.php?page=WPP_show_documentation1,5122.1229.6443.82
/wp-admin/admin.php?page=#280.440.103.63
WP Portfolio /wp-admin/admin.php?page=wp-portfolio/wp-portfolio.php8342.2326.5926.39
Portfolio Settings /wp-admin/admin.php?page=WPP_show_settings7551.6211.2322.66
Error Logs /wp-admin/admin.php?page=WPP_show_error_page8492.0827.6926.61
Add New Website /wp-admin/admin.php?page=WPP_modify_website7551.6211.2623.01
Website Groups /wp-admin/admin.php?page=WPP_website_groups9102.1126.3730.01
Refresh Thumbnails /wp-admin/admin.php?page=WPP_show_refreshThumbnails1,0192.0825.8528.19
Add New Group /wp-admin/admin.php?page=WPP_modify_group9862.2326.2028.52
Layout Settings /wp-admin/admin.php?page=WPP_show_layout_settings1,3472.0637.6935.88

Uninstaller [IO: ▲0.00MB] [DB: ▲0.01MB] 25% from 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin cannot be uninstalled
    • > Deprecated in wp-content/plugins/wp-portfolio/wplib/utils_pagebuilder.inc.php+25
    Methods with the same name as their class will not be constructors in a future version of PHP; PageBuilder has a deprecated constructor
  • This plugin does not fully uninstall, leaving 6 tables in the database
    • wp_WPPortfolio_custom_fields
    • wp_WPPortfolio_websites_meta
    • wp_WPPortfolio_groups
    • wp_WPPortfolio_websites
    • wp_WPPortfolio_debuglog
    • wp_WPPortfolio_groups_websites
  • This plugin does not fully uninstall, leaving 40 options in the database
    • WPPortfolio_setting_stw_render_type
    • WPPortfolio_setting_stw_enable_https_set_automatically
    • WPPortfolio_setting_scale_type
    • WPPortfolio_setting_cache_days
    • widget_recent-posts
    • WPPortfolio_setting_template_css_widget
    • WPPortfolio_setting_stw_thumb_size
    • can_compress_scripts
    • widget_wp-portfolio-widget
    • WPPortfolio_setting_stw_thumb_resolution_custom
    • ...

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Please fix the following server-side errors
  • 9 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=WPP_show_layout_settings
    • > Deprecated in wp-content/plugins/wp-portfolio/wplib/utils_pagebuilder.inc.php+25
    Methods with the same name as their class will not be constructors in a future version of PHP; PageBuilder has a deprecated constructor
  • 9 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=WPP_show_layout_settings
    • > Deprecated in wp-content/plugins/wp-portfolio/wplib/utils_formbuilder.inc.php+74
    Methods with the same name as their class will not be constructors in a future version of PHP; FormBuilder has a deprecated constructor
  • 9 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=WPP_show_layout_settings
    • > Deprecated in wp-content/plugins/wp-portfolio/wplib/utils_formbuilder.inc.php+743
    Methods with the same name as their class will not be constructors in a future version of PHP; FormElement has a deprecated constructor
  • 9 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=WPP_show_layout_settings
    • > Deprecated in wp-content/plugins/wp-portfolio/wplib/utils_tablebuilder.inc.php+26
    Methods with the same name as their class will not be constructors in a future version of PHP; TableBuilder has a deprecated constructor
  • 9 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=WPP_show_layout_settings
    • > Deprecated in wp-content/plugins/wp-portfolio/wplib/utils_tablebuilder.inc.php+144
    Methods with the same name as their class will not be constructors in a future version of PHP; RowData has a deprecated constructor
  • 9 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=WPP_show_layout_settings
    • > Deprecated in wp-content/plugins/wp-portfolio/wplib/utils_tablebuilder.inc.php+280
    Methods with the same name as their class will not be constructors in a future version of PHP; TableColumn has a deprecated constructor
  • 9 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=WPP_show_layout_settings
    • > Deprecated in wp-content/plugins/wp-portfolio/lib/widget.inc.php+183
    Function create_function() is deprecated
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=WPP_modify_website
    • > Warning in wp-content/plugins/wp-portfolio/wp-portfolio.php+2175
    DOMDocument::loadXML(): Start tag expected, '<' not found in Entity, line: 1
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=WPP_modify_website
    • > Warning in wp-content/plugins/wp-portfolio/wp-portfolio.php+2176
    simplexml_import_dom(): Invalid Nodetype to import
    • > GET request to /wp-admin/admin.php?page=WPP_show_settings
    • > Error in wp-content/plugins/wp-portfolio/wp-portfolio.php+2183
    Uncaught Error: Call to a member function children() on null in wp-content/plugins/wp-portfolio/wp-portfolio.php:2183
    Stack trace:
    #0 wp-content/plugins/wp-portfolio/lib/admin_only.inc.php(614): WPPortfolio_hasCustomAccountFeature()
    #1 wp-includes/class-wp-hook.php(310): WPPortfolio_pages_showSettings()
    #2 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(517): WP_Hook->do_action()
    #4 wp-admin/admin.php(259): do_action()
    #5 {main}
    thrown
    • > GET request to /wp-admin/admin.php?page=WPP_modify_website
    • > Error in wp-content/plugins/wp-portfolio/wp-portfolio.php+2183
    Uncaught Error: Call to a member function children() on null in wp-content/plugins/wp-portfolio/wp-portfolio.php:2183
    Stack trace:
    #0 wp-content/plugins/wp-portfolio/lib/admin_only.inc.php(1996): WPPortfolio_hasCustomAccountFeature()
    #1 wp-includes/class-wp-hook.php(310): WPPortfolio_modify_website()
    #2 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(517): WP_Hook->do_action()
    #4 wp-admin/admin.php(259): do_action()
    #5 {main}
    thrown

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/wp-portfolio/wp-portfolio.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/wp-portfolio/lib/widget.inc.php:5

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please take a look at the following user-side issues
  • 9 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=WPP_show_layout_settings
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: $j(...).live is not a function" "TypeError: $j(...).live is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/wp-portfolio/js/wpp-admin.js?ver=1.43.2:179:19)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
  • 9 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=WPP_show_layout_settings
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: $j(...).live is not a function
    • > GET request to /wp-admin/admin.php?page=#
    • > Network (severe)
    wp-admin/admin.php?page=# - Failed to load resource: the server responded with a status of 403 (Forbidden)

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
5 plugin tags: responsive portfolio, web page screenshots, gallery, portfolio, website screenshots

wp-portfolio/wp-portfolio.php 92% from 13 tests

This is the main PHP file of "Wordpress Portfolio Plugin (WP Portfolio)" version 1.43.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Description: The description should be shorter than 140 characters (currently 351 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin8,687 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
PHP101,5782,0185,957
PO File15315841,766
JavaScript84852513
CSS410225451

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity30.75
▷ Minimum class complexity1.00
▷ Maximum class complexity135.00
Average method complexity3.98
▷ Minimum method complexity1.00
▷ Maximum method complexity47.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods80
▷ Static methods11.25%
▷ Public methods7695.00%
▷ Protected methods22.50%
▷ Private methods22.50%
Functions95
▷ Named functions95100.00%
▷ Anonymous functions00.00%
Constants36
▷ Global constants36100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
8 compressed PNG files occupy 0.01MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
imgs/icon_stop.png0.68KB0.78KB0.00%
imgs/icon_hide.png0.70KB0.39KB▼ 45.06%
imgs/icon-logo.png4.90KB4.00KB▼ 18.41%
imgs/icon_show.png0.87KB0.80KB▼ 7.88%
imgs/icon_tick.png0.52KB0.52KB0.00%