84% waj-image

Code Review | WAJ Image

WordPress plugin WAJ Image scored84%from 54 tests.

About plugin

  • Plugin page: waj-image
  • Plugin version: 3.0.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.0-5.2
  • WordPress version: 6.3.1
  • First release: Nov 30, 2018
  • Latest release: May 20, 2019
  • Number of updates: 16
  • Update frequency: every 10.7 days
  • Top authors: waughjai (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /953 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.08MB] [CPU: ▼12.75ms] Passed 4 tests

Analyzing server-side resources used by WAJ Image
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.10 ▼0.3620.01 ▼20.80
Dashboard /wp-admin3.58 ▲0.2745.09 ▼2.88
Posts /wp-admin/edit.php3.63 ▲0.2746.53 ▲0.86
Add New Post /wp-admin/post-new.php6.09 ▲0.2180.43 ▼28.18
Media Library /wp-admin/upload.php3.44 ▲0.2135.32 ▲1.17
Directories /wp-admin/themes.php?page=theme_directories3.5431.34

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 230 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
theme_directories_options
widget_theysaidso_widget
widget_recent-comments
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

WAJ Image: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5814.48 ▲0.111.61 ▼0.1840.46 ▼3.20
Dashboard /wp-admin2,213 ▲644.87 ▼0.7296.03 ▼3.2437.59 ▼1.00
Posts /wp-admin/edit.php2,093 ▲42.03 ▼0.0138.73 ▼1.9135.09 ▲0.32
Add New Post /wp-admin/post-new.php1,545 ▲2618.30 ▼4.78601.33 ▼36.1353.39 ▲2.55
Media Library /wp-admin/upload.php1,386 ▼24.24 ▲0.0097.41 ▼0.2340.87 ▼1.07
Directories /wp-admin/themes.php?page=theme_directories7812.0327.1927.00

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • theme_directories_options
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 32× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WaughJ\\HTMLImage\\HTMLImage' not found in wp-content/plugins/waj-image/vendor/waughj/wp-theme-image/src/WPThemeImage.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/waj-image/vendor/waughj/wp-upload-image/tests/WPUploadImageTest.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function WaughJ\\WPThemeOption\\__() in wp-content/plugins/waj-image/vendor/waughj/wp-theme-option/src/WPThemeOptionsPage.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/waj-image/vendor/waughj/wp-get-image-sizes/tests/WPGetImageSizesTest.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/waj-image/vendor/waughj/verified-arguments/tests/VerifiedArgumentsTest.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/waj-image/vendor/waughj/html-image/tests/HTMLImageTest.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'WaughJ\\VerifiedArguments\\VerifiedArguments' not found in wp-content/plugins/waj-image/vendor/waughj/verified-arguments-same-type/src/VerifiedArgumentsSameType.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/waj-image/vendor/waughj/wp-theme-image/tests/WPThemeImageTest.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/waj-image/vendor/waughj/html-image/tests/SrcSetTest.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'WaughJ\\WPUploadPicture\\WPUploadPicture' not found in wp-content/plugins/waj-image/vendor/waughj/wp-post-thumbnail/src/WPPostThumbnail.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
3 plugin tags: html generator, loader, image

waj-image/waj-image.php 92% from 13 tests

The main PHP file in "WAJ Image" ver. 3.0.0 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected7,263 lines of code in 129 files:
LanguageFilesBlank linesComment linesLines of code
PHP809521,4095,140
JSON21001,455
Markdown252960651
XML10012
YAML2205

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity5.32
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity1.78
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces24
Interfaces7
Traits1
Classes57
▷ Abstract classes00.00%
▷ Concrete classes57100.00%
▷ Final classes00.00%
Methods432
▷ Static methods5212.04%
▷ Public methods39591.44%
▷ Protected methods10.23%
▷ Private methods368.33%
Functions147
▷ Named functions12887.07%
▷ Anonymous functions1912.93%
Constants20
▷ Global constants00.00%
▷ Class constants20100.00%
▷ Public constants20100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
9 compressed PNG files occupy 0.00MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
(invalid) vendor/waughj/wp-theme-picture/tests/img/favicon.png0.00KB0.00KB0.00%
(invalid) vendor/waughj/html-picture/tests/somegone-480x320.png0.00KB0.00KB0.00%
(invalid) vendor/waughj/wp-upload-image/tests/2018/12/demo.png0.00KB0.00KB0.00%
(invalid) vendor/waughj/wp-theme-picture/favicon.png0.00KB0.00KB0.00%
(invalid) vendor/waughj/wp-theme-image/tests/img/favicon.png0.00KB0.00KB0.00%