94% wp-amd

Code Review | WP-AMD - Global JS and CSS handling

WordPress plugin WP-AMD - Global JS and CSS handling scored 94% from 54 tests.

About plugin

  • Plugin page: wp-amd
  • Plugin version: 1.2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.5.3
  • WordPress version: 5.8.1
  • First release: Mar 20, 2014
  • Latest release: Feb 16, 2018
  • Number of updates: 13
  • Update frequency: every 110.0 days
  • Top authors: andypotanin (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active / 2,322 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.70MB] [CPU: ▼137.37ms] Passed 4 tests

Server-side resources used by WP-AMD - Global JS and CSS handling
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.42 ▲0.5825.20 ▲0.48
Dashboard /wp-admin3.82 ▲0.7637.39 ▼2.21
Posts /wp-admin/edit.php3.87 ▲0.7638.28 ▲3.14
Add New Post /wp-admin/post-new.php6.12 ▲0.6890.13 ▼550.87
Media Library /wp-admin/upload.php3.77 ▲0.7643.81 ▲18.80
Scripts /wp-admin/themes.php?page=amd-page-script3.7534.25
Styles /wp-admin/themes.php?page=amd-page-style3.7535.10

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 671 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP-AMD - Global JS and CSS handling
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,681 ▲8015.99 ▲0.039.19 ▲4.3273.83 ▲1.85
Dashboard /wp-admin2,940 ▲446.08 ▼0.09114.48 ▼30.56164.22 ▼14.58
Posts /wp-admin/edit.php2,750 ▲73.23 ▼0.0161.93 ▼1.92133.60 ▼4.23
Add New Post /wp-admin/post-new.php3,704 ▼10418.31 ▼0.08428.95 ▼19.16159.47 ▼2.10
Media Library /wp-admin/upload.php1,762 ▲105.54 ▼0.02164.13 ▲13.72213.42 ▲32.33
Scripts /wp-admin/themes.php?page=amd-page-script1,6224.34105.62159.44
Styles /wp-admin/themes.php?page=amd-page-style1,5763.9394.11142.18

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 31× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'UsabilityDynamics\\UI\\Field' not found in wp-content/plugins/wp-amd/vendor/usabilitydynamics/lib-ui/lib/class-field-multiple.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'UsabilityDynamics\\UI\\Field' not found in wp-content/plugins/wp-amd/vendor/usabilitydynamics/lib-ui/lib/fields/class-taxonomy.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wp-amd/static/templates/style-edit-page.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/wp-amd/vendor/usabilitydynamics/lib-ui/static/templates/admin/tab.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wp-amd/static/templates/script-edit-page.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'UsabilityDynamics\\UI\\Field_Select_Advanced' not found in wp-content/plugins/wp-amd/vendor/usabilitydynamics/lib-ui/lib/fields/class-post.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'UsabilityDynamics\\UI\\Field' not found in wp-content/plugins/wp-amd/vendor/usabilitydynamics/lib-ui/lib/fields/class-datetime.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Customize_Control' not found in wp-content/plugins/wp-amd/lib/customizer/class-customize-editor-control.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/wp-amd/wp-amd.php:41
    • > PHP Fatal error
      Uncaught Error: Class 'UsabilityDynamics\\AMD\\Scaffold' not found in wp-content/plugins/wp-amd/lib/class-style.php:15

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 Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
9 plugin tags: customize, customizer, css handling, css, global css...

wp-amd/wp-amd.php Passed 13 tests

The main PHP script in "WP-AMD - Global JS and CSS handling" version 1.2.2 is automatically included on every request by WordPress
27 characters long description:
Global JS and CSS handling.

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 plugin35,377 lines of code in 619 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript5085,6444,85024,830
PHP501,6903,1745,192
CSS203012312,026
HTML107731,322
JSON1410871
LESS515748587
Markdown8800302
XHTML3316162
XML10185

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity24.64
▷ Minimum class complexity1.00
▷ Maximum class complexity304.00
Average method complexity4.21
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces5
Interfaces0
Traits0
Classes39
▷ Abstract classes12.56%
▷ Concrete classes3897.44%
▷ Final classes00.00%
Methods290
▷ Static methods15553.45%
▷ Public methods27695.17%
▷ Protected methods00.00%
▷ Private methods144.83%
Functions7
▷ Named functions228.57%
▷ Anonymous functions571.43%
Constants4
▷ Global constants4100.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
20 PNG files occupy 0.18MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/usabilitydynamics/lib-ui/static/styles/fields/jqueryui/img/ui-icons_454545_256x240.png4.27KB4.11KB▼ 3.78%
vendor/usabilitydynamics/lib-ui/static/styles/fields/jqueryui/img/ui-bg_glass_55_fbf9ee_1x400.png0.12KB0.14KB0.00%
vendor/usabilitydynamics/lib-ui/static/styles/fields/select2/select2.png0.60KB0.99KB0.00%
static/screenshots/script-editor.png96.48KB26.47KB▼ 72.56%
vendor/usabilitydynamics/lib-ui/static/styles/fields/select2/select2x2.png0.83KB0.77KB▼ 6.15%