84% portfolio-media

Code Review | Portfolio Media

WordPress plugin Portfolio Media scored84%from 54 tests.

About plugin

  • Plugin page: portfolio-media
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.4
  • WordPress version: 6.3.1
  • First release: Apr 1, 2013
  • Latest release: May 3, 2013
  • Number of updates: 24
  • Update frequency: every 1.4 days
  • Top authors: Deanobyte (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

10+ active /2,921 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.33MB] [CPU: ▼3.59ms] Passed 4 tests

An overview of server-side resources used by Portfolio Media
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.81 ▲0.3442.14 ▼4.15
Dashboard /wp-admin3.69 ▲0.3448.97 ▼15.56
Posts /wp-admin/edit.php3.74 ▲0.3856.31 ▲1.79
Add New Post /wp-admin/post-new.php6.20 ▲0.3298.37 ▲3.55
Media Library /wp-admin/upload.php3.55 ▲0.3238.91 ▲4.75
Single Page Settings /wp-admin/admin.php?page=portfolio-media-single3.5139.41
Grid Settings /wp-admin/admin.php?page=portfolio-media-grid3.5135.47
Portfolio Categories /wp-admin/edit-tags.php?taxonomy=portfolio_category&post_type=portfolio_media3.5436.20
Portfolio /wp-admin/edit.php?post_type=portfolio_media3.6541.03
Media Settings /wp-admin/admin.php?page=portfolio-media-media3.5136.21
Portfolio Media /wp-admin/admin.php?page=portfolio-media3.5137.07
Add New /wp-admin/post-new.php?post_type=portfolio_media3.7655.39
General Settings /wp-admin/admin.php?page=portfolio-media-general3.5141.82

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 24 new files
Database: no new tables, 12 new options
New WordPress options
pm_single_display
widget_recent-posts
pm_media_image
pm_grid_display
widget_recent-comments
db_upgraded
can_compress_scripts
pm_single_layout
pm_general_basic
widget_theysaidso_widget
...

Browser metrics Passed 4 tests

An overview of browser requirements for Portfolio Media
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,982 ▲23613.92 ▼0.886.00 ▲4.2242.61 ▼1.56
Dashboard /wp-admin2,288 ▲1035.26 ▼0.64108.29 ▼4.6541.56 ▲1.14
Posts /wp-admin/edit.php2,174 ▲852.39 ▲0.3837.83 ▼1.4234.24 ▼2.29
Add New Post /wp-admin/post-new.php1,415 ▼10417.26 ▼6.05512.28 ▼158.5426.99 ▼25.73
Media Library /wp-admin/upload.php1,469 ▲814.54 ▲0.3199.87 ▼7.7942.30 ▼3.75
Single Page Settings /wp-admin/admin.php?page=portfolio-media-single8951.9526.9434.41
Grid Settings /wp-admin/admin.php?page=portfolio-media-grid1,1262.0927.9429.97
Portfolio Categories /wp-admin/edit-tags.php?taxonomy=portfolio_category&post_type=portfolio_media1,3411.9927.2929.37
Portfolio /wp-admin/edit.php?post_type=portfolio_media1,1412.3534.2629.65
Media Settings /wp-admin/admin.php?page=portfolio-media-media9011.9625.7828.85
Portfolio Media /wp-admin/admin.php?page=portfolio-media8901.9526.5826.29
Add New /wp-admin/post-new.php?post_type=portfolio_media2,4097.84173.4065.22
General Settings /wp-admin/admin.php?page=portfolio-media-general8951.9626.3729.43

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 9 options in the database
    • pm_grid_layout
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • pm_grid_display
    • pm_general_basic
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function delete_option() in wp-content/plugins/portfolio-media/uninstall.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/portfolio-media/plugin.php:43

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Please fix the following attributes:
  • Plugin Name: You should set the name of your plugin on the first line ( === portfolio-media === )
The official readme.txt might help

portfolio-media/plugin.php 92% from 13 tests

The entry point to "Portfolio Media" version 1.1 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("portfolio-media.php" instead of "plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected4,079 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript48741,0782,654
PHP102941571,018
CSS38577374
HTML16321
XML10012

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity13.00
▷ Minimum class complexity5.00
▷ Maximum class complexity23.00
Average method complexity2.01
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes111.11%
▷ Concrete classes888.89%
▷ Final classes00.00%
Methods111
▷ Static methods21.80%
▷ Public methods10594.59%
▷ Protected methods65.41%
▷ Private methods00.00%
Functions0
▷ Named functions00.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
2 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
scripts/video-js/video-js.png8.04KB3.82KB▼ 52.47%
scripts/video-js/tubesprite.png7.28KB4.20KB▼ 42.31%