10% sherky-simple-portfolio

Code Review | Sherky Simple Portfolio

WordPress plugin Sherky Simple Portfolio scored 10% from 54 tests.

About plugin

  • Plugin page: sherky-simple-por...
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.2.2
  • WordPress version: 6.3.1
  • First release: Mar 25, 2015
  • Latest release: May 15, 2015
  • Number of updates: 6
  • Update frequency: every 8.5 days
  • Top authors: sherkspear (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,537 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Please fix the following installer errors
  • Install procedure had errors
    • > User deprecated in wp-includes/functions.php+5643
    File upgrade-functions.php is deprecated since version 2.5.0! Use wp-admin/includes/upgrade.php instead.

Server metrics [RAM: ▼1.93MB] [CPU: ▼53.81ms] Passed 4 tests

A check of server-side resources used by Sherky Simple Portfolio
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.05 ▼1.414.39 ▼49.11
Dashboard /wp-admin2.07 ▼1.236.05 ▼41.04
Posts /wp-admin/edit.php2.08 ▼1.286.69 ▼39.05
Add New Post /wp-admin/post-new.php2.07 ▼3.816.18 ▼86.02
Media Library /wp-admin/upload.php2.07 ▼1.155.84 ▼26.12
How To Use /wp-admin/admin.php?page=sherkportfolio_menu_page2.086.86
Add New Project /wp-admin/admin.php?page=portfolio_add_project2.086.13
Portfolio /wp-admin/admin.php?page=portfolio_menu2.085.83

Server storage [IO: ▲0.26MB] [DB: ▲0.00MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 24 new files
Database: 2 new tables, 6 new options
New tables
wp_sherkportfolioprojects
wp_sherkportfoliopersonal
New WordPress options
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Sherky Simple Portfolio
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,827 ▲8113.18 ▼1.121.57 ▼0.3239.71 ▼7.53
Dashboard /wp-admin2,236 ▲485.90 ▲0.04115.37 ▼1.4144.57 ▲1.35
Posts /wp-admin/edit.php2,116 ▲241.99 ▲0.0039.33 ▼0.9935.30 ▼4.80
Add New Post /wp-admin/post-new.php1,556 ▲1923.45 ▲0.35668.20 ▼1.3656.66 ▲3.50
Media Library /wp-admin/upload.php1,418 ▲334.24 ▲0.0299.41 ▼4.0844.36 ▲1.35
How To Use /wp-admin/admin.php?page=sherkportfolio_menu_page1,1192.0226.8742.47
Add New Project /wp-admin/admin.php?page=portfolio_add_project9081.9635.6827.73
Portfolio /wp-admin/admin.php?page=portfolio_menu9341.8333.4627.79

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • Uninstall procedure had uncaught errors
    • > User deprecated in wp-includes/functions.php+5643
    File upgrade-functions.php is deprecated since version 2.5.0! Use wp-admin/includes/upgrade.php instead.
  • This plugin does not fully uninstall, leaving 2 tables in the database
    • wp_sherkportfolioprojects
    • wp_sherkportfoliopersonal
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These errors were triggered by the plugin
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=portfolio_menu
    • > User deprecated in wp-includes/functions.php+5643
    File upgrade-functions.php is deprecated since version 2.5.0! Use wp-admin/includes/upgrade.php instead.
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=portfolio_menu
    • > Deprecated in wp-includes/class-wp-hook.php+308
    Non-static method SherkPortfolio::enable() should not be called statically
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=portfolio_menu
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method MenuPortfolio::setupMenu() should not be called statically
  • 9 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=portfolio_menu
    • > Warning in wp-content/plugins/sherky-simple-portfolio/classes/Menu.php+12
    Use of undefined constant MenuPortfolio - assumed 'MenuPortfolio' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/admin.php?page=sherkportfolio_menu_page
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method MenuPortfolio::sherkportfolio_menu_page() should not be called statically
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=portfolio_menu
    • > Deprecated in wp-content/plugins/sherky-simple-portfolio/forms/createportfolio.php+5
    Non-static method SherkPortfolio::getBaseDir() should not be called statically
    • > GET request to /wp-admin/admin.php?page=portfolio_add_project
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method MenuPortfolio::portfolio_add_project() should not be called statically
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=portfolio_menu
    • > Warning in wp-content/plugins/sherky-simple-portfolio/forms/createportfolio.php+5
    include(wp-content/plugins/sherky-simple-portfolio/scripts/sherkportfolio.css): failed to open stream: No such file or directory
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=portfolio_menu
    • > Warning in wp-content/plugins/sherky-simple-portfolio/forms/createportfolio.php+5
    include(): Failed opening 'wp-content/plugins/sherky-simple-portfolio/scripts/sherkportfolio.css' for inclusion (include_path='.:/usr/share/php')
    • > GET request to /wp-admin/admin.php?page=portfolio_add_project
    • > Notice in wp-content/plugins/sherky-simple-portfolio/forms/portfolioproject.php+8
    Undefined index: action
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=portfolio_add_project
    • > Notice in wp-content/plugins/sherky-simple-portfolio/forms/portfolioproject.php+44
    Undefined index: id
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=portfolio_add_project
    • > Notice in wp-content/plugins/sherky-simple-portfolio/forms/portfolioproject.php+48
    Undefined index: name
    • > GET request to /wp-admin/admin.php?page=portfolio_add_project
    • > Notice in wp-content/plugins/sherky-simple-portfolio/forms/portfolioproject.php+51
    Undefined index: url
    • > GET request to /wp-admin/admin.php?page=portfolio_add_project
    • > Notice in wp-content/plugins/sherky-simple-portfolio/forms/portfolioproject.php+54
    Undefined index: screenshot
    • > GET request to /wp-admin/admin.php?page=portfolio_add_project
    • > Notice in wp-content/plugins/sherky-simple-portfolio/forms/portfolioproject.php+57
    Undefined index: description
    • > GET request to /wp-admin/admin.php?page=portfolio_add_project
    • > Notice in wp-content/plugins/sherky-simple-portfolio/forms/portfolioproject.php+60
    Undefined index: fromdate
    • > GET request to /wp-admin/admin.php?page=portfolio_add_project
    • > Notice in wp-content/plugins/sherky-simple-portfolio/forms/portfolioproject.php+63
    Undefined index: todate
    • > GET request to /wp-admin/admin.php?page=portfolio_add_project
    • > Deprecated in wp-content/plugins/sherky-simple-portfolio/forms/portfolioproject.php+87
    Non-static method HelperFunctionsPortfolio::getAllTableData() should not be called statically
    • > GET request to /wp-admin/admin.php?page=portfolio_menu
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method MenuPortfolio::create_portfolio() should not be called statically
    • > GET request to /wp-admin/admin.php?page=portfolio_menu
    • > Notice in wp-content/plugins/sherky-simple-portfolio/forms/createportfolio.php+8
    Undefined index: submit
    • > GET request to /wp-admin/admin.php?page=portfolio_menu
    • > Deprecated in wp-content/plugins/sherky-simple-portfolio/forms/createportfolio.php+17
    Non-static method HelperFunctionsPortfolio::getTableData() should not be called statically
    • > GET request to /wp-admin/admin.php?page=portfolio_menu
    • > Notice in wp-content/plugins/sherky-simple-portfolio/classes/HelperFunctions.php+17
    Undefined offset: 0
    • > GET request to /wp-admin/admin.php?page=portfolio_menu
    • > Notice in wp-content/plugins/sherky-simple-portfolio/forms/createportfolio.php+27
    Undefined variable: msg
  • 12 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=portfolio_menu
    • > Notice in wp-content/plugins/sherky-simple-portfolio/forms/createportfolio.php+67
    Trying to access array offset on value of type null

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 14× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/sherky-simple-portfolio/includes/Constants.php on line 7
    • > PHP Warning
      require_once(ABSPATHwp-admin/upgrade-functions.php): failed to open stream: No such file or directory in wp-content/plugins/sherky-simple-portfolio/database/Install.php on line 3
    • > PHP Warning
      require_once(ABSPATHwp-admin/upgrade-functions.php): failed to open stream: No such file or directory in wp-content/plugins/sherky-simple-portfolio/database/Install.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'SherkPortfolio' not found in wp-content/plugins/sherky-simple-portfolio/templates/sherkportfolio_dashboard.php:63
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/sherky-simple-portfolio/includes/Constants.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sherky-simple-portfolio/classes/SherkyPortfolioCssJsScripts.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'SherkPortfolio' not found in wp-content/plugins/sherky-simple-portfolio/forms/portfolioproject.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/sherky-simple-portfolio/classes/SherkyPortfolioShortcode.php:6
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/sherky-simple-portfolio/database/Install.php on line 3
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/sherky-simple-portfolio/database/Install.php on line 3

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please take a look at the following user-side issues
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=portfolio_menu
    • > Network (severe)
    wp-content/plugins/my-script.js?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
8 plugin tags: portfolio page, portfolios, create portfolios, portfolio, add portfolios...

sherky-simple-portfolio/SherkPortfolio.php 85% from 13 tests

"Sherky Simple Portfolio" version 1.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 145 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("sherky-simple-portfolio.php" instead of "SherkPortfolio.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin1,573 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript5102110664
PHP1118381543
CSS45822366

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity4.71
▷ Minimum class complexity1.00
▷ Maximum class complexity22.00
Average method complexity1.96
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods27
▷ Static methods13.70%
▷ Public methods27100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.05MB with 0.03MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/logo.png49.81KB14.78KB▼ 70.33%