72% cm-header-footer-script-loader

Code Review | CM Header & Footer Script Loader

WordPress plugin CM Header & Footer Script Loader scored72%from 54 tests.

About plugin

  • Plugin page: cm-header-footer-...
  • Plugin version: 1.1.8
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4.0-6.3
  • WordPress version: 6.3.1
  • First release: Sep 7, 2015
  • Latest release: Jul 23, 2023
  • Number of updates: 176
  • Update frequency: every 16.3 days
  • Top authors: CreativeMindsSolutions (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

1,000+ active /29,850 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.55MB] [CPU: ▼4.60ms] 75% from 4 tests

An overview of server-side resources used by CM Header & Footer Script Loader
The following require your attention
  • CPU: Try to keep total CPU usage under 500.00ms (currently 980.78ms on /wp-admin/admin.php?page=cm-handfsl)
PageMemory (MB)CPU Time (ms)
Home /3.98 ▲0.5146.96 ▲6.21
Dashboard /wp-admin3.93 ▲0.5857.64 ▼7.38
Posts /wp-admin/edit.php3.98 ▲0.6251.62 ▼1.01
Add New Post /wp-admin/post-new.php6.45 ▲0.5688.88 ▼15.21
Media Library /wp-admin/upload.php3.79 ▲0.5644.02 ▲5.20
User Guide /wp-admin/admin.php?page=cmhandfsl_about3.90395.05
Settings /wp-admin/admin.php?page=cm-handfsl4.01980.78
Upgrade ➤ /wp-admin/admin.php?page=cmhandfsl_pro3.7836.64

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 65 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by CM Header & Footer Script Loader
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,845 ▲8414.69 ▲0.412.01 ▲0.3745.26 ▼0.97
Dashboard /wp-admin2,220 ▲405.56 ▼0.1183.83 ▼9.1241.61 ▲2.51
Posts /wp-admin/edit.php2,131 ▲342.02 ▲0.0637.82 ▼1.4633.59 ▼7.69
Add New Post /wp-admin/post-new.php1,560 ▲1918.31 ▼4.60622.41 ▼32.1476.45 ▲23.73
Media Library /wp-admin/upload.php1,431 ▲314.21 ▲0.0196.47 ▼11.8544.91 ▲1.70
User Guide /wp-admin/admin.php?page=cmhandfsl_about3,98116.27419.43248.67
Settings /wp-admin/admin.php?page=cm-handfsl2,4768.5078.0774.02
Upgrade ➤ /wp-admin/admin.php?page=cmhandfsl_pro1,2342.1134.7355.78

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 0% from 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
Please take a closer look at the following
  • 3× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/cm-header-footer-script-loader/classes/class.cm-handfsl-backend.php
    • > /wp-content/plugins/cm-header-footer-script-loader/classes/class.cm-handfsl-frontend.php
    • > /wp-content/plugins/cm-header-footer-script-loader/cm-header-footer-script-loader.php
  • 5× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/cm-header-footer-script-loader/package/cminds-plugin-config.php:4
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/cm-header-footer-script-loader/package/views/userguide_free.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/cm-header-footer-script-loader/package/views/plugin_compare_table.php:51
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/cm-header-footer-script-loader/package/views/registration.php:42
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/cm-header-footer-script-loader/package/cminds-plugin-config.php:4

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please take a look at the following user-side issues
    • > GET request to /wp-admin/admin.php?page=cmhandfsl_about
    • > Security (warning) in unknown
    security - Error with Permissions-Policy header: Unrecognized feature: 'ambient-light-sensor'.
    • > GET request to /wp-admin/admin.php?page=cmhandfsl_about
    • > Security (warning) in unknown
    security - Error with Permissions-Policy header: Unrecognized feature: 'bluetooth'.
    • > GET request to /wp-admin/admin.php?page=cmhandfsl_about
    • > Deprecation (warning) in unknown
    https://static.xx.fbcdn.net/rsrc.php/v3/yD/r/CxzjCMQABR5.js?_nc_x=Ij3Wp8lg5Kz 271 Listener added for a synchronous 'DOMSubtreeModified' DOM Mutation Event. This event type is deprecated (https://w3c.github.io/uievents/#legacy-event-types) and work is underway to remove it from this browser. Usage of this event listener will cause performance issues today, and represents a risk of future incompatibility. Consider using MutationObserver instead.
    • > GET request to /wp-admin/admin.php?page=cmhandfsl_about
    • > Console-api (severe) in unknown
    https://static.xx.fbcdn.net/rsrc.php/v3/yD/r/CxzjCMQABR5.js?_nc_x=Ij3Wp8lg5Kz 60:573 "ErrorUtils caught an error:\n\nCannot listen to an undefined element. [Caught in: Tried to listen to element of type click]\n\nSubsequent non-fatal errors won't be logged; see https://fburl.com/debugjs."

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
5 plugin tags: scripts, optimize, styles, css, html

cm-header-footer-script-loader/cm-header-footer-script-loader.php Passed 13 tests

"CM Header & Footer Script Loader" version 1.1.8's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
76 characters long description:
This plugin allows you to load scripts and styles on selected posts or pages

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
Good job! No executable or dangerous file extensions detected5,599 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
PHP168655604,793
CSS31032629
PO File14547121
JavaScript411556

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity91.25
▷ Minimum class complexity8.00
▷ Maximum class complexity254.00
Average method complexity4.50
▷ Minimum method complexity1.00
▷ Maximum method complexity38.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods103
▷ Static methods1110.68%
▷ Public methods9289.32%
▷ Protected methods98.74%
▷ Private methods21.94%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants125.00%
▷ Class constants375.00%
▷ Public constants3100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
37 PNG files occupy 0.53MB with 0.29MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
package/views/searchreplace.png37.22KB10.60KB▼ 71.53%
package/views/routes.png12.59KB4.78KB▼ 62.02%
package/views/img/confetti.png2.77KB2.01KB▼ 27.65%
package/views/answers.png38.71KB10.31KB▼ 73.37%
package/css/images/ui-icons_222222_256x240.png6.76KB4.17KB▼ 38.24%