83% shift8-portfolio

Code Review | Shift8 Portfolio

WordPress plugin Shift8 Portfolio scored83%from 54 tests.

About plugin

  • Plugin page: shift8-portfolio
  • Plugin version: 1.12
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.8
  • WordPress version: 6.3.1
  • First release: Dec 3, 2016
  • Latest release: Dec 22, 2021
  • Number of updates: 26
  • Update frequency: every 70.6 days
  • Top authors: shift8 (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

10+ active /1,478 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▼5.90ms] Passed 4 tests

A check of server-side resources used by Shift8 Portfolio
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0836.15 ▼7.64
Dashboard /wp-admin3.40 ▲0.0551.77 ▼13.45
Posts /wp-admin/edit.php3.52 ▲0.1549.80 ▲3.97
Add New Post /wp-admin/post-new.php5.98 ▲0.0984.14 ▼6.46
Media Library /wp-admin/upload.php3.30 ▲0.0737.46 ▲4.33
Shift8 Portfolios /wp-admin/edit.php?post_type=shift8_portfolio3.3737.38
Add New /wp-admin/post-new.php?post_type=shift8_portfolio3.4154.69

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 22 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
db_upgraded
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Shift8 Portfolio
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,981 ▲22014.52 ▼0.022.54 ▲0.8242.80 ▼0.61
Dashboard /wp-admin2,372 ▲1956.24 ▲0.71104.24 ▼1.2935.92 ▼5.48
Posts /wp-admin/edit.php2,313 ▲2133.57 ▲1.5749.87 ▲14.0531.28 ▼1.74
Add New Post /wp-admin/post-new.php1,562 ▲3423.20 ▼0.04640.20 ▼20.9636.29 ▼21.73
Media Library /wp-admin/upload.php1,450 ▲474.20 ▲0.0194.71 ▼3.1150.68 ▲3.91
Shift8 Portfolios /wp-admin/edit.php?post_type=shift8_portfolio1,2773.4643.6726.99
Add New /wp-admin/post-new.php?post_type=shift8_portfolio2,2587.83160.9059.46

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/shift8-portfolio/components/enqueuing.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/shift8-portfolio/template/single-portfolio.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/shift8-portfolio/shift8-portfolio.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/shift8-portfolio/components/custompost.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/shift8-portfolio/components/metabox.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 81% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that require attention:
  • Tags: Please delete some tags, you are using 12 tag instead of maximum 10
  • Contributors: There were no tags found
  • Contributors: Plugin contributors field is missing
The official readme.txt is a good inspiration

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

"Shift8 Portfolio" version 1.12's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 272 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected2,479 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
CSS9701011,058
JavaScript5118164709
JSON100392
PHP53845319
C#1011

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
PNG images were not found in this plugin