10% webphysiology-portfolio

Code Review | WEBphysiology Portfolio

WordPress plugin WEBphysiology Portfolio scored10%from 54 tests.

About plugin

  • Plugin page: webphysiology-por...
  • Plugin version: 1.4.8
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1.0-3.5.1
  • WordPress version: 6.3.1
  • First release: Oct 18, 2010
  • Latest release: Mar 24, 2013
  • Number of updates: 219
  • Update frequency: every 4.1 days
  • Top authors: lambje (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

100+ active /52,429 total downloads

Benchmarks

Plugin footprint 40% 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
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/webphysiology-portfolio/function.php+2706
    Function create_function() is deprecated

Server metrics [RAM: ▼1.92MB] [CPU: ▼56.77ms] Passed 4 tests

An overview of server-side resources used by WEBphysiology Portfolio
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.07 ▼1.394.45 ▼38.60
Dashboard /wp-admin2.09 ▼1.225.35 ▼48.18
Posts /wp-admin/edit.php2.09 ▼1.275.49 ▼46.34
Add New Post /wp-admin/post-new.php2.09 ▼3.807.64 ▼91.47
Media Library /wp-admin/upload.php2.09 ▼1.145.87 ▼41.09
Portfolio Types /wp-admin/edit-tags.php?taxonomy=webphys_portfolio_type&post_type=webphys_portfolio2.095.41
Portfolio /wp-admin/edit.php?post_type=webphys_portfolio2.096.63
Portfolio Tags /wp-admin/edit-tags.php?taxonomy=webphys_portfolio_tag&post_type=webphys_portfolio2.095.64
Options /wp-admin/edit.php?post_type=webphys_portfolio&page=webphysiology-portfolio2.095.76
Add Portfolio /wp-admin/post-new.php?post_type=webphys_portfolio2.096.08

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 94 new files
Database: no new tables, 57 new options
New WordPress options
webphysiology_portfolio_display_tech
webphysiology_portfolio_debug_mode
webphysiology_portfolio_gridstyle
webphysiology_portfolio_overall_width
webphysiology_portfolio_image_click_behavior
webphysiology_portfolio_display_clientname
widget_recent-comments
webphysiology_portfolio_skip_fancybox_register
widget_webphys_portfolio_widget
webphysiology_portfolio_display_desc_first
...

Browser metrics Passed 4 tests

Checking browser requirements for WEBphysiology Portfolio
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,832 ▲7114.72 ▲0.161.85 ▲0.2943.75 ▼0.98
Dashboard /wp-admin2,221 ▲445.56 ▼0.0587.68 ▼4.7566.83 ▲24.78
Posts /wp-admin/edit.php2,208 ▲1262.84 ▲0.8144.06 ▲6.2334.91 ▼3.25
Add New Post /wp-admin/post-new.php1,558 ▲2423.46 ▲5.15622.32 ▼67.35158.88 ▲86.51
Media Library /wp-admin/upload.php1,438 ▲384.22 ▲0.1098.90 ▼15.4375.02 ▲25.01
Portfolio Types /wp-admin/edit-tags.php?taxonomy=webphys_portfolio_type&post_type=webphys_portfolio1,3942.1327.3933.94
Portfolio /wp-admin/edit.php?post_type=webphys_portfolio1,2632.8544.6030.11
Portfolio Tags /wp-admin/edit-tags.php?taxonomy=webphys_portfolio_tag&post_type=webphys_portfolio1,2842.1525.5830.18
Options /wp-admin/edit.php?post_type=webphys_portfolio&page=webphysiology-portfolio1,9242.5436.7745.98
Add Portfolio /wp-admin/post-new.php?post_type=webphys_portfolio2,3657.71184.17122.50

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/webphysiology-portfolio/function.php+2706
    Function create_function() is deprecated
  • Zombie WordPress options detected upon uninstall: 57 options
    • webphysiology_portfolio_pagepeeker_account
    • webphysiology_portfolio_custom_css_url
    • webphysiology_portfolio_database_version
    • webphysiology_portfolio_delete_data
    • db_upgraded
    • webphysiology_portfolio_label_width
    • webphysiology_portfolio_max_img_height
    • webphysiology_portfolio_display_portfolio_title
    • theysaidso_admin_options
    • webphysiology_portfolio_crop_thumbnail
    • ...

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Smoke test failed, please fix the following
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=webphys_portfolio
    • > Deprecated in wp-content/plugins/webphysiology-portfolio/function.php+2706
    Function create_function() is deprecated
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=webphys_portfolio
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in webphys_portfolio_widget is deprecated since version 4.3.0! Use __construct() instead.
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=webphys_portfolio
    • > Notice in wp-content/plugins/webphysiology-portfolio/function.php+4182
    Undefined variable: file
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=webphys_portfolio&page=webphysiology-portfolio
    • > User notice in wp-includes/functions.php+5905
    Function wp_deregister_script was called incorrectly. Do not deregister the jquery script in the administration area. To target the front-end theme, use the wp_enqueue_scripts hook. Please see Debugging in WordPress for more information. (This message was added in version 3.6.0.)
    • > GET request to /wp-admin/edit.php?post_type=webphys_portfolio&page=webphysiology-portfolio
    • > Notice in wp-content/plugins/webphysiology-portfolio/function.php+1092
    Undefined variable: check_pp
    • > GET request to /wp-admin/edit.php?post_type=webphys_portfolio&page=webphysiology-portfolio
    • > Notice in wp-content/plugins/webphysiology-portfolio/function.php+1092
    Undefined variable: check_stw
    • > GET request to /wp-admin/post-new.php?post_type=webphys_portfolio
    • > Notice in wp-content/plugins/webphysiology-portfolio/function.php+266
    Undefined variable: post_ID

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/webphysiology-portfolio/chmod_image_cache.php
    • > /wp-content/plugins/webphysiology-portfolio/clear_image_caches.php
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_webphys_port_options() in wp-content/plugins/webphysiology-portfolio/loop-portfolio.php:52
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/webphysiology-portfolio/single-webphys_portfolio.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/webphysiology-portfolio/function.php:76
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/webphysiology-portfolio/function.php:76

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There are user-side issues you should fix
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=webphys_portfolio&page=webphysiology-portfolio
    • > Javascript (severe) in unknown
    /wp-content/plugins/webphysiology-portfolio/scripts/fancybox/jquery.fancybox-1.3.4.pack.js?ver=6.3.1 17:218 Uncaught TypeError: Cannot read properties of undefined (reading 'msie')
    • > GET request to /wp-admin/edit.php?post_type=webphys_portfolio
    • > 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: jQuery(...).fancybox is not a function" "TypeError: jQuery(...).fancybox is not a function\n at HTMLDocument.\u003Canonymous> (/wp-admin/edit.php?post_type=webphys_portfolio:308:27)\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
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=webphys_portfolio&page=webphysiology-portfolio
    • > 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: jQuery(...).fancybox is not a function
    • > GET request to /wp-admin/edit.php?post_type=webphys_portfolio&page=webphysiology-portfolio
    • > 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: jQuery(...).fancybox is not a function" "TypeError: jQuery(...).fancybox is not a function\n at HTMLDocument.\u003Canonymous> (/wp-admin/edit.php?post_type=webphys_portfolio&page=webphysiology-portfolio:463:27)\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

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Screenshots: These screenshots require images: #1 (Portfolio Page Frontend User Interface), #2 (Portfolio Post edit screen), #3 (Portfolio Page edit screen showing [shortcode] implementation), #4 (Portfolio options screen), #5 (Portfolio Tag Cloud widget)
  • Tags: Please delete some tags, you are using 15 tag instead of maximum 10
You can look at the official readme.txt

webphysiology-portfolio/portfolio-main.php 85% from 13 tests

"WEBphysiology Portfolio" version 1.4.8's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("webphysiology-portfolio.php" instead of "portfolio-main.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 153 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin6,181 lines of code in 33 files:
LanguageFilesBlank linesComment linesLines of code
PHP101,0799123,911
JavaScript93682351,197
CSS99675866
HTML52343207

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity14.67
▷ Minimum class complexity7.00
▷ Maximum class complexity29.00
Average method complexity5.10
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes266.67%
▷ Concrete classes133.33%
▷ Final classes00.00%
Methods10
▷ Static methods660.00%
▷ Public methods770.00%
▷ Protected methods00.00%
▷ Private methods330.00%
Functions94
▷ Named functions94100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants360.00%
▷ Class constants240.00%
▷ Public constants2100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
50 PNG files occupy 2.54MB with 1.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png233.83KB50.08KB▼ 78.58%
images/nav_button_right_selected.png0.15KB0.10KB▼ 30.97%
screenshot-4.png1,263.43KB358.09KB▼ 71.66%
scripts/fancybox/fancy_shadow_se.png0.34KB0.48KB0.00%
images/mail-square-webtreatsetc-16x16.png0.74KB0.59KB▼ 20.61%