72% wp-js-impress

Code Review | imPress

WordPress plugin imPress scored 72% from 53 tests.

About plugin

  • Plugin page: wp-js-impress
  • Plugin version: 0.1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.5
  • WordPress version: 5.8.1
  • First release: Nov 21, 2012
  • Latest release: Dec 17, 2012
  • Number of updates: 23
  • Update frequency: every 1.2 days
  • Top authors: hanusek@gmail.com (100%)

Code review

53 tests

User reviews

4 reviews

Install metrics

10+ active / 4,779 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.62MB] [CPU: ▼258.56ms] Passed 4 tests

Server-side resources used by imPress
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.15 ▲0.4336.41 ▲10.02
Dashboard /wp-admin3.74 ▲0.6945.78 ▼4.05
Posts /wp-admin/edit.php3.79 ▲0.6944.74 ▼1.13
Add New Post /wp-admin/post-new.php6.11 ▲0.6899.06 ▼1,025.16
Media Library /wp-admin/upload.php3.69 ▲0.6834.02 ▼3.91
Impress /wp-admin/edit.php?post_type=impress3.7333.34
Order /wp-admin/edit.php?post_type=impress&page=product-order3.6643.90
Add New /wp-admin/post-new.php?post_type=impress3.5329.59
Settings /wp-admin/edit.php?post_type=impress&page=impress_theme_options3.6638.38

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 245 new files
Database: no new tables, 1 new option
New WordPress options
impress_options

Browser metrics Passed 4 tests

Checking browser requirements for imPress
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,751 ▲14515.98 ▲0.177.57 ▼1.2051.68 ▲3.57
Dashboard /wp-admin2,999 ▲1496.18 ▲0.16138.02 ▲11.51120.38 ▲21.93
Posts /wp-admin/edit.php2,741 ▲352.62 ▼0.0763.47 ▼0.6394.75 ▲1.13
Add New Post /wp-admin/post-new.php1,668 ▼18922.06 ▲2.84267.42 ▼100.38113.79 ▲5.68
Media Library /wp-admin/upload.php1,759 ▼135.02 ▲0.01124.13 ▼11.60126.16 ▲11.89
Impress /wp-admin/edit.php?post_type=impress1,4342.5865.9459.81
Order /wp-admin/edit.php?post_type=impress&page=product-order1,0502.3649.4161.42
Add New /wp-admin/post-new.php?post_type=impress3,0728.86224.81174.08
Settings /wp-admin/edit.php?post_type=impress&page=impress_theme_options1,6183.0369.2492.47

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • The uninstall procedure has failed, leaving 1 option in the database
    • impress_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
Please fix the following server-side errors
    • > GET request to /wp-admin/post-new.php?post_type=impress
    • > Notice in wp-content/plugins/wp-js-impress/inc/sort-order.php+111
    Trying to get property 'post_status' of non-object
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=impress&page=impress_theme_options
    • > Notice in wp-content/plugins/wp-js-impress/inc/options/options.php+466
    Undefined offset: 1
    • > GET request to /wp-admin/edit.php?post_type=impress&page=impress_theme_options
    • > Notice in wp-content/plugins/wp-js-impress/inc/options/fields/google_webfonts/field_google_webfonts.php+46
    Undefined property: stdClass::$items
    • > GET request to /wp-admin/edit.php?post_type=impress&page=impress_theme_options
    • > Warning in wp-content/plugins/wp-js-impress/inc/options/fields/google_webfonts/field_google_webfonts.php+46
    Invalid argument supplied for foreach()

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 take a closer look at the following
  • 66× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-js-impress/inc/meta-box/demo/include-by-ID-or-page-template.php:44
    • > PHP Fatal error
      Uncaught Error: Class 'IMPRESS_Options' not found in wp-content/plugins/wp-js-impress/inc/options/validation/comma_numeric/validation_comma_numeric.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-js-impress/inc/shortcode.php:162
    • > PHP Fatal error
      Uncaught Error: Class 'IMPRESS_Options' not found in wp-content/plugins/wp-js-impress/inc/options/validation/color/validation_color.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-js-impress/inc/meta-box/demo/demo.php:283
    • > PHP Fatal error
      Uncaught Error: Class 'IMPRESS_Options' not found in wp-content/plugins/wp-js-impress/inc/options/validation/html/validation_html.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-js-impress/inc/meta-box/demo/all-custom-post-types.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'IMPRESS_Options' not found in wp-content/plugins/wp-js-impress/inc/options/fields/range/field_range.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'IMPRESS_Options' not found in wp-content/plugins/wp-js-impress/inc/options/fields/tags_select/field_tags_select.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'IMPRESS_Options' not found in wp-content/plugins/wp-js-impress/inc/options/fields/text/field_text.php:2

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please take a look at the following user-side issues
    • > GET request to /wp-admin/edit.php?post_type=impress&page=impress_theme_options
    • > Network (severe)
    http://fonts.googleapis.com/css?family= - Failed to load resource: the server responded with a status of 400 (Bad Request)
    • > GET request to /wp-admin/edit.php?post_type=impress&page=impress_theme_options
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,farbtastic&ver=5.8.1 1:31592 "jQuery.Deferred exception: $colorpicker_inputs.live is not a function" "TypeError: $colorpicker_inputs.live is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/wp-js-impress/inc/options/fields/color/field_color.js?ver=1635089927:42:22)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,farbtastic&ver=5.8.1:2:30038)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,farbtastic&ver=5.8.1:2:30340)" undefined
    • > GET request to /wp-admin/edit.php?post_type=impress&page=impress_theme_options
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,farbtastic&ver=5.8.1 1:31702 Uncaught TypeError: $colorpicker_inputs.live is not a function

Optimizations

Plugin configuration 93% 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 to be fixed:
  • Tags: Please delete some tags, you are using 13 tag instead of maximum 10
The official readme.txt might help

wp-js-impress/impress.php 92% from 13 tests

The principal PHP file in "imPress" v. 0.1.4 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("wp-js-impress.php" instead of "impress.php")

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
No dangerous file extensions were detected9,908 lines of code in 157 files:
LanguageFilesBlank linesComment linesLines of code
PHP931,6772,4004,980
CSS181862832,008
JavaScript293083871,281
LESS714034718
PO File7164210539
JSON110278
SVG101101
Markdown1103

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity7.25
▷ Minimum class complexity1.00
▷ Maximum class complexity110.00
Average method complexity3.02
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes73
▷ Abstract classes00.00%
▷ Concrete classes73100.00%
▷ Final classes00.00%
Methods226
▷ Static methods9742.92%
▷ Public methods226100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions48
▷ Named functions48100.00%
▷ Anonymous functions00.00%
Constants18
▷ Global constants18100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 0% from 1 test

Image compression 0% from 1 test

Using a strong compression for your PNG files is a great way to speed-up your plugin
74 PNG files occupy 2.32MB with 1.48MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/impress.png1.31KB0.50KB▼ 61.76%
img/hexagon-02.png31.26KB21.01KB▼ 32.78%
img/stars-4.png42.25KB23.35KB▼ 44.73%
inc/options/fields/upload/blank.png0.90KB0.09KB▼ 89.72%
img/icons/Icon.png25.02KB2.88KB▼ 88.50%