84% custom-script-for-customizer

Code Review | Custom Header Footer Scripts for Customizer

WordPress plugin Custom Header Footer Scripts for Customizer scored 84% from 54 tests.

About plugin

  • Plugin page: custom-script-for...
  • Plugin version: 1.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.3
  • WordPress version: 6.3.1
  • First release: Nov 4, 2017
  • Latest release: Aug 20, 2023
  • Number of updates: 10
  • Update frequency: every 211.5 days
  • Top authors: re_enter_rupok (100%)

Code review

54 tests

User reviews

1 review

Install metrics

3,000+ active / 19,425 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼7.81ms] Passed 4 tests

A check of server-side resources used by Custom Header Footer Scripts for Customizer
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0639.83 ▼3.06
Dashboard /wp-admin3.35 ▲0.0545.71 ▼8.80
Posts /wp-admin/edit.php3.47 ▲0.1148.45 ▲2.41
Add New Post /wp-admin/post-new.php5.93 ▲0.0592.51 ▼5.24
Media Library /wp-admin/upload.php3.28 ▲0.0537.11 ▼14.14

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

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

Browser metrics Passed 4 tests

Custom Header Footer Scripts for Customizer: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,802 ▲6714.48 ▲0.181.73 ▼0.0044.80 ▼11.42
Dashboard /wp-admin2,208 ▲204.86 ▼1.04113.16 ▲1.8339.99 ▼10.45
Posts /wp-admin/edit.php2,088 ▼11.99 ▲0.0139.62 ▲0.7130.75 ▼1.23
Add New Post /wp-admin/post-new.php1,539 ▲618.37 ▼4.92619.20 ▲25.9890.48 ▲15.19
Media Library /wp-admin/upload.php1,393 ▲54.19 ▼0.0494.72 ▼12.2542.18 ▼3.74

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
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check 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 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/custom-script-for-customizer/admin/partials/custom-script-for-customizer-admin-display.php:29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/custom-script-for-customizer/admin/class-custom-script-for-customizer-admin.php:116

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention: The official readme.txt is a good inspiration

custom-script-for-customizer/custom-script-for-customizer.php Passed 13 tests

The main PHP file in "Custom Header Footer Scripts for Customizer" ver. 1.1.1 adds more information about the plugin and also serves as the entry point for this plugin
80 characters long description:
Add custom scripts through WordPress Customizer and edit with CodeMirror editor.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin209 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP10118384194
CSS12015

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.10
Average class complexity1.50
▷ Minimum class complexity1.00
▷ Maximum class complexity3.00
Average method complexity1.17
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods18
▷ Static methods211.11%
▷ Public methods1477.78%
▷ Protected methods00.00%
▷ Private methods422.22%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
PNG images were not found in this plugin