62% global-javascript

Code Review | Global Javascript

WordPress plugin Global Javascript scored62%from 54 tests.

About plugin

  • Plugin page: global-javascript
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Mar 11, 2013
  • Latest release: Mar 12, 2013
  • Number of updates: 12
  • Update frequency: N/A
  • Top authors: psmagicman (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

200+ active /11,215 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▼1.01MB] [CPU: ▼39.66ms] Passed 4 tests

Analyzing server-side resources used by Global Javascript
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.82 ▼0.6514.53 ▼27.83
Dashboard /wp-admin3.05 ▼0.2628.92 ▼20.52
Posts /wp-admin/edit.php3.05 ▼0.3124.18 ▼24.44
Add New Post /wp-admin/post-new.php3.05 ▼2.8422.13 ▼85.85
Media Library /wp-admin/upload.php3.05 ▼0.1823.99 ▼12.27
Global Javascript /wp-admin/themes.php?page=global-javascript/global-javascript.php3.0525.67

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Global Javascript
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.22 ▼1.161.65 ▼0.7647.48 ▼17.38
Dashboard /wp-admin2,210 ▲224.87 ▼0.01109.72 ▼7.9542.42 ▲1.43
Posts /wp-admin/edit.php2,096 ▲42.02 ▲0.0160.39 ▲18.8738.36 ▲6.05
Add New Post /wp-admin/post-new.php1,522 ▼1123.40 ▲0.43647.74 ▼12.4056.43 ▼19.43
Media Library /wp-admin/upload.php1,386 ▼24.18 ▲0.01100.94 ▼6.8442.14 ▼4.21
Global Javascript /wp-admin/themes.php?page=global-javascript/global-javascript.php1,0323.2784.6349.39

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin did not uninstall without warnings or errors
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These server-side errors were triggered
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/themes.php?page=global-javascript/global-javascript.php
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
    • > GET request to /wp-admin/themes.php?page=global-javascript/global-javascript.php
    • > Notice in wp-content/plugins/global-javascript/global-javascript.php+478
    Undefined variable: error_id
    • > GET request to /wp-admin/themes.php?page=global-javascript/global-javascript.php
    • > Notice in wp-content/plugins/global-javascript/global-javascript.php+481
    Undefined variable: message_number
    • > GET request to /wp-admin/themes.php?page=global-javascript/global-javascript.php
    • > Notice in wp-content/plugins/global-javascript/global-javascript.php+281
    Only variables should be passed by reference
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/themes.php?page=global-javascript/global-javascript.php
    • > Notice in wp-content/plugins/global-javascript/global-javascript.php+355
    Trying to access array offset on value of type bool
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/themes.php?page=global-javascript/global-javascript.php
    • > POST request to /wp-cron.php?doing_wp_cron=1696658530.1360850334167480468750
    • > Notice in wp-content/plugins/pressforward/Core/Utility/Retrieval.php+204
    Undefined offset: 0
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/themes.php?page=global-javascript/global-javascript.php
    • > POST request to /wp-cron.php?doing_wp_cron=1696658530.1360850334167480468750
    • > Notice in wp-content/plugins/pressforward/Core/Utility/Retrieval.php+205
    Trying to get property 'guid' of non-object
  • 12 occurences, only the last one shown
    • > GET request to /wp-admin/themes.php?page=global-javascript/global-javascript.php
    • > POST request to /wp-cron.php?doing_wp_cron=1696658530.1360850334167480468750
    • > Notice in wp-content/plugins/pressforward/Core/Utility/Retrieval.php+221
    Trying to get property 'ID' of non-object
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/themes.php?page=global-javascript/global-javascript.php
    • > POST request to /wp-cron.php?doing_wp_cron=1696658530.1360850334167480468750
    • > Notice in wp-content/plugins/pressforward/Core/Utility/Retrieval.php+222
    Trying to get property 'post_title' of non-object

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 fix the following items
  • 3× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/global-javascript/min/builder/index.php
    • > /wp-content/plugins/global-javascript/min/index.php
    • > /wp-content/plugins/global-javascript/min/builder/ocCheck.php
  • 7× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'Minify_Controller_Base' not found in wp-content/plugins/global-javascript/min/lib/Minify/Controller/Version1.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Minify_Controller_Base' not found in wp-content/plugins/global-javascript/min/lib/Minify/Controller/MinApp.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Minify_Controller_Base' not found in wp-content/plugins/global-javascript/min/lib/Minify/Controller/Files.php:27
    • > PHP Fatal error
      The script "class.JavaScriptPacker.php" is required. Please see: http://code.google.com/p/minify/source/browse/trunk/min/lib/Minify/Packer.php in wp-content/plugins/global-javascript/min/lib/Minify/Packer.php on line 21
    • > PHP Fatal error
      Uncaught Error: Class 'Minify_Controller_Base' not found in wp-content/plugins/global-javascript/min/lib/Minify/Controller/Groups.php:29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/global-javascript/global-javascript.php:49
    • > PHP Fatal error
      Uncaught Error: Class 'Minify_Controller_Base' not found in wp-content/plugins/global-javascript/min/lib/Minify/Controller/Page.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 81% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Requires at least: Version not formatted correctly
  • Tags: There are too many tags (20 tag instead of maximum 10)
  • Donate link: Please fix this invalid URI: ""
The official readme.txt might help

global-javascript/global-javascript.php Passed 13 tests

Analyzing the main PHP file in "Global Javascript" version 1.0
72 characters long description:
Allows the creation and editing of Javascript on Wordpress powered sites

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin7,659 lines of code in 138 files:
LanguageFilesBlank linesComment linesLines of code
PHP471,2674,0386,436
JavaScript88228100961
Java17477231
CSS27431

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Please tend to the following items
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 155)
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity30.48
▷ Minimum class complexity1.00
▷ Maximum class complexity229.00
Average method complexity5.61
▷ Minimum method complexity1.00
▷ Maximum method complexity155.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes48
▷ Abstract classes12.08%
▷ Concrete classes4797.92%
▷ Final classes00.00%
Methods308
▷ Static methods6420.78%
▷ Public methods19964.61%
▷ Protected methods5417.53%
▷ Private methods5517.86%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants125
▷ Global constants9979.20%
▷ Class constants2620.80%
▷ Public constants26100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
8 PNG files occupy 0.44MB with 0.30MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot 3.png79.04KB27.12KB▼ 65.68%
screenshot 4.png16.61KB5.89KB▼ 64.53%
screenshot 1.png120.96KB32.60KB▼ 73.05%
screenshot-2.png10.53KB3.72KB▼ 64.70%
screenshot-4.png16.61KB5.89KB▼ 64.53%