79% custom-php-codes

Code Review | Plugin Name: Custom PHP Codes

WordPress plugin Plugin Name: Custom PHP Codes scored79%from 54 tests.

About plugin

  • Plugin page: custom-php-codes
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3.1-4.9.4
  • WordPress version: 6.3.1
  • First release: Mar 18, 2018
  • Latest release: Mar 23, 2018
  • Number of updates: 8
  • Update frequency: every 0.8 days
  • Top authors: spcits (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /568 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼5.19ms] Passed 4 tests

A check of server-side resources used by Plugin Name: Custom PHP Codes
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0142.05 ▼0.54
Dashboard /wp-admin3.38 ▲0.0848.49 ▼6.14
Posts /wp-admin/edit.php3.49 ▲0.1450.46 ▼2.81
Add New Post /wp-admin/post-new.php5.96 ▲0.0883.42 ▼11.28
Media Library /wp-admin/upload.php3.30 ▲0.0841.53 ▲1.91
Custom Settings /wp-admin/admin.php?page=customphpcode3.2734.68
Custom PHP Codes /wp-admin/admin.php?page=SPcits_Custom_PHP_Code3.2836.42

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 18 new files
Database: 1 new table, 7 new options
New tables
wp_customphpcode
New WordPress options
widget_recent-posts
theysaidso_admin_options
db_upgraded
can_compress_scripts
customphpcode_options
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Plugin Name: Custom PHP Codes
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,813 ▲5214.28 ▲0.021.94 ▲0.0147.70 ▲4.69
Dashboard /wp-admin2,225 ▲455.62 ▲0.0988.52 ▼7.6538.83 ▼7.16
Posts /wp-admin/edit.php2,127 ▲272.04 ▼0.0435.10 ▼6.6633.53 ▼5.42
Add New Post /wp-admin/post-new.php1,548 ▲2023.78 ▲0.45670.08 ▲36.4352.80 ▼5.06
Media Library /wp-admin/upload.php1,427 ▲244.20 ▲0.0199.40 ▼0.4346.21 ▲1.41
Custom Settings /wp-admin/admin.php?page=customphpcode8342.0025.5228.51
Custom PHP Codes /wp-admin/admin.php?page=SPcits_Custom_PHP_Code1,0371.6727.3629.03

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • The plugin did not uninstall successfully, leaving 1 table in the database
    • wp_customphpcode
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • customphpcode_options
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 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
These attributes need your attention:
  • Tags: Too many tags (11 tag instead of maximum 10); only the first 5 tags are used in your directory listing
  • Plugin Name: You should set the name of your plugin on the first line ( === Plugin Name: Custom PHP Codes === )
You can look at the official readme.txt

custom-php-codes/customphpcode.php 85% from 13 tests

The main PHP script in "Plugin Name: Custom PHP Codes" version 1.0 is automatically included on every request by WordPress
You should first fix the following items:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: Name the main plugin file the same as the plugin slug ("custom-php-codes.php" instead of "customphpcode.php")

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 detected427 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP85413427

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity11.00
▷ Minimum class complexity2.00
▷ Maximum class complexity20.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods20
▷ Static methods630.00%
▷ Public methods20100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions9
▷ Named functions888.89%
▷ Anonymous functions111.11%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin