78% abraia

Code Review | Abraia – Bulk image optimizer

WordPress plugin Abraia – Bulk image optimizer scored 78% from 54 tests.

About plugin

  • Plugin page: abraia
  • Plugin version: 1.1.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.4
  • WordPress version: 5.9.2
  • First release: Apr 3, 2020
  • Latest release: Apr 14, 2020
  • Number of updates: 4
  • Update frequency: every 2.8 days
  • Top authors: jrrodri (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 888 total downloads

Benchmarks

Plugin footprint 82% from 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 gracefully, with no errors

Server metrics [RAM: ▲0.22MB] [CPU: ▲114.11ms] 75% from 4 tests

This is a short check of server-side resources used by Abraia – Bulk image optimizer
It is recommended to improve the following
  • CPU: Try to keep total CPU usage under 500.00ms (currently 554.01ms on /wp-admin/options-general.php?page=abraia)
PageMemory (MB)CPU Time (ms)
Home /3.70 ▲0.19451.01 ▲400.60
Dashboard /wp-admin3.65 ▲0.24443.27 ▲409.63
Posts /wp-admin/edit.php3.87 ▲0.23535.35 ▲498.95
Add New Post /wp-admin/post-new.php7.18 ▲0.21528.16 ▼750.96
Media Library /wp-admin/upload.php3.59 ▲0.29420.91 ▲397.15
Bulk Abraia /wp-admin/upload.php?page=abraia_bulk_page3.48411.75
Abraia /wp-admin/options-general.php?page=abraia3.47554.01

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 27 new files
Database: no new tables, 1 new option
New WordPress options
abraia_settings

Browser metrics Passed 4 tests

Checking browser requirements for Abraia – Bulk image optimizer
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,902 ▲18016.08 ▲0.305.20 ▼0.412.02 ▼0.34
Dashboard /wp-admin3,030 ▲1696.05 ▼0.05131.70 ▼3.06219.01 ▲52.96
Posts /wp-admin/edit.php2,827 ▲1393.23 ▼0.0162.63 ▼1.74168.17 ▲26.74
Add New Post /wp-admin/post-new.php2,018 ▲35118.46 ▼1.27425.94 ▲31.00184.34 ▲30.74
Media Library /wp-admin/upload.php1,836 ▲1385.58 ▲0.03123.27 ▼18.37218.48 ▲34.80
Bulk Abraia /wp-admin/upload.php?page=abraia_bulk_page1,3542.5154.02227.91
Abraia /wp-admin/options-general.php?page=abraia1,4962.3854.92193.07

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • The uninstall procedure has failed, leaving 1 option in the database
    • abraia_settings

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Smoke test failed, please fix the following
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=abraia
    • > Notice in wp-content/plugins/abraia/admin/settings.php+115
    Undefined variable: user
  • 12 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=abraia
    • > Notice in wp-content/plugins/abraia/admin/settings.php+219
    Trying to access array offset on value of type null

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 fix the following items
  • 4× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/abraia/admin/settings.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/abraia/admin/bulk.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/abraia/admin/media.php:247
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_oembed_add_provider() in wp-content/plugins/abraia/abraia.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
5 plugin tags: compress images, image optimizer, image compressor, optimize performance, optimize images

abraia/abraia.php Passed 13 tests

The main PHP file in "Abraia – Bulk image optimizer" ver. 1.1.1 adds more information about the plugin and also serves as the entry point for this plugin
111 characters long description:
Bulk optimize your WordPress and WooCommerce images with Abraia to speed up your website with the best quality.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected1,772 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP131541761,296
CSS100256
PO File14848118
JSON300102

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity15.40
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity2.57
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods47
▷ Static methods36.38%
▷ Public methods4595.74%
▷ Protected methods00.00%
▷ Private methods24.26%
Functions28
▷ Named functions2692.86%
▷ Anonymous functions27.14%
Constants2
▷ Global constants150.00%
▷ Class constants150.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
4 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/icon.png0.79KB0.64KB▼ 18.24%
assets/delete.png1.66KB1.43KB▼ 13.83%
assets/logo.png5.46KB3.65KB▼ 33.16%
assets/checkmark.png1.64KB1.47KB▼ 10.30%