84% sp-framework

Code Review | SP Framework

WordPress plugin SP Framework scored84%from 54 tests.

About plugin

  • Plugin page: sp-framework
  • Plugin version: 2.0.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.4
  • WordPress version: 6.3.1
  • First release: Dec 7, 2019
  • Latest release: Nov 24, 2020
  • Number of updates: 11
  • Update frequency: every 32.2 days
  • Top authors: spoot1986 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /625 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.26MB] [CPU: ▼3.87ms] Passed 4 tests

A check of server-side resources used by SP Framework
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.75 ▲0.2839.92 ▼1.50
Dashboard /wp-admin3.61 ▲0.3057.98 ▼8.90
Posts /wp-admin/edit.php3.66 ▲0.3054.35 ▼3.36
Add New Post /wp-admin/post-new.php6.13 ▲0.2490.69 ▼1.71
Media Library /wp-admin/upload.php3.45 ▲0.2238.15 ▼0.19

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 31 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for SP Framework
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,966 ▲19514.80 ▲0.572.04 ▲0.1244.07 ▲2.99
Dashboard /wp-admin2,350 ▲1626.49 ▲0.63124.39 ▼9.4343.13 ▼4.63
Posts /wp-admin/edit.php2,256 ▲1643.54 ▲1.5353.90 ▲14.0932.61 ▼0.55
Add New Post /wp-admin/post-new.php1,522 ▼1123.24 ▲0.10644.30 ▼13.4835.31 ▼32.67
Media Library /wp-admin/upload.php1,383 ▼24.15 ▼0.0586.34 ▼20.5143.50 ▼9.01

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • 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 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
Please fix the following
  • 11× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'SP_Framework_Main' not found in wp-content/plugins/sp-framework/classes/class-sp-framework-post-type-meta-box.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/sp-framework/sp-framework.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'SP_Framework_Main' not found in wp-content/plugins/sp-framework/classes/class-sp-framework-post-type.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'SP_Framework_Main' not found in wp-content/plugins/sp-framework/classes/class-sp-framework-taxonomy.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'SP_Framework_Main' not found in wp-content/plugins/sp-framework/classes/class-sp-framework-admin-meta-box.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'SP_Framework_Main' not found in wp-content/plugins/sp-framework/classes/class-sp-framework-enqueue.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sp-framework/classes/class-sp-framework-init.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'SP_Framework_Main' not found in wp-content/plugins/sp-framework/classes/class-sp-framework-user-meta-box.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/sp-framework/classes/class-sp-framework-widget.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'SP_Framework_Main' not found in wp-content/plugins/sp-framework/classes/class-sp-framework-taxonomy-meta-box.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
2 plugin tags: development, framework

sp-framework/sp-framework.php 92% from 13 tests

This is the main PHP file of "SP Framework" version 2.0.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin1,904 lines of code in 27 files:
LanguageFilesBlank linesComment linesLines of code
PHP23356501,565
JavaScript1640167
PO File256144150
CSS14022

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity12.14
▷ Minimum class complexity1.00
▷ Maximum class complexity42.00
Average method complexity3.74
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces0
Interfaces0
Traits1
Classes21
▷ Abstract classes29.52%
▷ Concrete classes1990.48%
▷ Final classes00.00%
Methods85
▷ Static methods2428.24%
▷ Public methods5261.18%
▷ Protected methods11.18%
▷ Private methods3237.65%
Functions35
▷ Named functions00.00%
▷ Anonymous functions35100.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/img/none.png11.47KB4.58KB▼ 60.09%