84% super-cpt

Code Review | SuperCPT

WordPress plugin SuperCPT scored84%from 54 tests.

About plugin

  • Plugin page: super-cpt
  • Plugin version: 0.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.6
  • WordPress version: 6.3.1
  • First release: Feb 10, 2013
  • Latest release: Aug 10, 2013
  • Number of updates: 16
  • Update frequency: every 11.3 days
  • Top authors: mboynes (100%)

Code review

54 tests

User reviews

14 reviews

Install metrics

1,000+ active /15,995 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.18MB] [CPU: ▼5.32ms] Passed 4 tests

An overview of server-side resources used by SuperCPT
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1843.03 ▲1.96
Dashboard /wp-admin3.49 ▲0.1846.88 ▼0.73
Posts /wp-admin/edit.php3.60 ▲0.2448.52 ▼6.98
Add New Post /wp-admin/post-new.php6.09 ▲0.2082.47 ▼15.53
Media Library /wp-admin/upload.php3.41 ▲0.1838.42 ▲3.90
SuperCPT /wp-admin/tools.php?page=super_cpt3.7132.71

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for SuperCPT
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲7113.17 ▼1.091.70 ▼0.1244.32 ▼5.99
Dashboard /wp-admin2,212 ▲245.91 ▲1.03102.42 ▼7.7940.70 ▼2.60
Posts /wp-admin/edit.php2,095 ▲32.03 ▲0.0338.05 ▼5.6534.78 ▼1.72
Add New Post /wp-admin/post-new.php1,519 ▼923.19 ▲5.25651.69 ▲13.2951.39 ▼6.55
Media Library /wp-admin/upload.php1,391 ▼04.24 ▲0.02108.18 ▲7.2242.87 ▼3.32
SuperCPT /wp-admin/tools.php?page=super_cpt3,0532.0126.8776.42

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • 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 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
Please fix the following
  • 4× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/super-cpt/super-cpt.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'Super_Custom_Post_Meta' not found in wp-content/plugins/super-cpt/includes/class-super-custom-post-type.php:9
    • > PHP Warning
      Use of undefined constant SCPT_PLUGIN_URL - assumed 'SCPT_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/super-cpt/includes/class-scpt-font-awesome.php on line 34
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/super-cpt/includes/class-scpt-font-awesome.php:37

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 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
8 plugin tags: meta, custom-taxonomy, custom-field, custom-taxonomies, cms...

super-cpt/super-cpt.php Passed 13 tests

This is the main PHP file of "SuperCPT" version 0.2.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
87 characters long description:
Insanely easy and attractive custom post types, custom post meta, and custom taxonomies

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin2,180 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP82716641,675
SVG100399
CSS17375
JavaScript13031

PHP code 50% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
These items need your attention
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 377)
Cyclomatic complexity
Average complexity per logical line of code0.83
Average class complexity79.14
▷ Minimum class complexity2.00
▷ Maximum class complexity389.00
Average method complexity9.04
▷ Minimum method complexity1.00
▷ Maximum method complexity377.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods68
▷ Static methods45.88%
▷ Public methods6494.12%
▷ Protected methods34.41%
▷ Private methods11.47%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
There were not PNG files found in your plugin