83% sgp-grid-portfolio

Code Review | SGP portfolio

WordPress plugin SGP portfolio scored83%from 54 tests.

About plugin

  • Plugin page: sgp-grid-portfolio
  • Plugin version: 3.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.5
  • WordPress version: 6.3.1
  • First release: Sep 3, 2016
  • Latest release: Sep 20, 2017
  • Number of updates: 32
  • Update frequency: every 11.9 days
  • Top authors: chayaneng (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /595 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.06MB] [CPU: ▼5.16ms] Passed 4 tests

Analyzing server-side resources used by SGP portfolio
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0129.05 ▼8.34
Dashboard /wp-admin3.39 ▲0.0850.01 ▼0.18
Posts /wp-admin/edit.php3.45 ▲0.0946.00 ▼1.80
Add New Post /wp-admin/post-new.php5.99 ▲0.1081.82 ▼10.32
Media Library /wp-admin/upload.php3.31 ▲0.0833.37 ▲0.93
Add New /wp-admin/post-new.php?post_type=sgp_portfolio3.4446.01
Type /wp-admin/edit-tags.php?taxonomy=spp-portfolio-type&post_type=sgp_portfolio3.3133.58
All portfolios /wp-admin/edit.php?post_type=sgp_portfolio3.3635.43

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 14 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by SGP portfolio
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,990 ▲25513.68 ▼0.7210.82 ▲8.9044.21 ▲1.76
Dashboard /wp-admin2,236 ▲455.88 ▼0.02105.33 ▼6.7838.86 ▼3.79
Posts /wp-admin/edit.php2,122 ▲332.08 ▲0.0434.15 ▼7.3636.09 ▼2.00
Add New Post /wp-admin/post-new.php1,542 ▲917.49 ▼5.82665.85 ▲35.8560.18 ▲7.48
Media Library /wp-admin/upload.php1,424 ▲334.41 ▲0.2099.76 ▲1.3642.45 ▼1.45
Add New /wp-admin/post-new.php?post_type=sgp_portfolio2,3277.79182.2766.99
Type /wp-admin/edit-tags.php?taxonomy=spp-portfolio-type&post_type=sgp_portfolio1,2642.1529.1425.49
All portfolios /wp-admin/edit.php?post_type=sgp_portfolio1,0922.0032.6628.39

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget

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
The smoke test was a success, however most plugin functionality was not tested

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
Almost there! Just fix the following items
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sgp-grid-portfolio/init.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/sgp-grid-portfolio/single-sgp_portfolio.php:1

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 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Contributors: Plugin contributors not specified
  • Donate link: Please fix this invalid url: "http:/chayaneng12.com/"
You can take inspiration from this readme.txt

sgp-grid-portfolio/init.php 92% from 13 tests

The main file in "SGP portfolio" v. 3.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("sgp-grid-portfolio.php" instead of "init.php")

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
Everything looks great! No dangerous files found in this plugin843 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript86875342
PHP25517282
CSS24114219

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.32
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%
Functions13
▷ Named functions13100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There are no PNG files in this plugin