83% custom-global-variables

Code Review | Custom Global Variables

WordPress plugin Custom Global Variables scored83%from 54 tests.

About plugin

  • Plugin page: custom-global-var...
  • Plugin version: 1.1.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.1.1
  • WordPress version: 6.3.1
  • First release: Apr 7, 2016
  • Latest release: Mar 22, 2023
  • Number of updates: 27
  • Update frequency: every 94.1 days
  • Top authors: abdullahkhalfan (66.67%)akirak (37.04%)

Code review

54 tests

User reviews

10 reviews

Install metrics

6,000+ active /15,645 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.00MB] [CPU: ▼2.76ms] Passed 4 tests

A check of server-side resources used by Custom Global Variables
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0136.99 ▼5.46
Dashboard /wp-admin3.31 ▲0.0149.53 ▼2.00
Posts /wp-admin/edit.php3.36 ▲0.0048.64 ▲2.25
Add New Post /wp-admin/post-new.php5.89 ▲0.0083.84 ▼5.20
Media Library /wp-admin/upload.php3.23 ▲0.0033.76 ▲1.62
Custom Global Variables /wp-admin/options-general.php?page=custom-global-variables3.2033.13

Server storage [IO: ▲0.01MB] [DB: ▲0.00MB] 67% from 3 tests

How much does this plugin use your filesystem and database?
Just a few items left to fix
  • Illegal file modification detected: 1 file (0.00KB) outside of "wp-content/plugins/custom-global-variables/" and "wp-content/uploads/"
    • (new file) wp-content/custom-global-variables/01520bfd9fbe4a0dfcca84778e405e9a.json
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Custom Global Variables
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲9414.48 ▲0.071.98 ▼0.0142.31 ▼6.49
Dashboard /wp-admin2,207 ▲165.78 ▲0.91101.49 ▼3.0039.78 ▼3.28
Posts /wp-admin/edit.php2,093 ▲42.02 ▲0.0139.47 ▲1.0435.20 ▲0.50
Add New Post /wp-admin/post-new.php1,531 ▲1718.10 ▲0.54649.48 ▲52.6955.29 ▼18.26
Media Library /wp-admin/upload.php1,392 ▲44.24 ▲0.0296.04 ▼3.6744.16 ▼0.58
Custom Global Variables /wp-admin/options-general.php?page=custom-global-variables8272.0627.7838.24

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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 fix the following items
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Warning
      Use of undefined constant WP_CONTENT_DIR - assumed 'WP_CONTENT_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/custom-global-variables/custom-global-variables.php on line 19
    • > PHP Warning
      Use of undefined constant AUTH_KEY - assumed 'AUTH_KEY' (this will throw an Error in a future version of PHP) in wp-content/plugins/custom-global-variables/custom-global-variables.php on line 19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_mkdir_p() in wp-content/plugins/custom-global-variables/custom-global-variables.php:39

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Please fix the following attributes:
  • Tags: Please delete some tags, you are using 15 tag instead of maximum 10
You can look at the official readme.txt

custom-global-variables/custom-global-variables.php 92% from 13 tests

The main file in "Custom Global Variables" v. 1.1.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Description: Please keep the plugin description shorter than 140 characters (currently 150 characters long)

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
Everything looks great! No dangerous files found in this plugin199 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP18019133
Sass119059
JavaScript1316
CSS1001

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity16.00
▷ Minimum class complexity16.00
▷ Maximum class complexity16.00
Average method complexity4.75
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
delete.png2.01KB0.79KB▼ 60.53%