84% avif-express

Code Review | Avif Express

WordPress plugin Avif Express scored84%from 54 tests.

About plugin

  • Plugin page: avif-express
  • Plugin version: 2023.06.28
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.2
  • WordPress version: 6.3.1
  • First release: Jan 17, 2023
  • Latest release: Jun 28, 2023
  • Number of updates: 14
  • Update frequency: every 11.6 days
  • Top authors: Pijush_Gupta (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /2,582 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.16MB] [CPU: ▼2.83ms] Passed 4 tests

A check of server-side resources used by Avif Express
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1342.35 ▲2.21
Dashboard /wp-admin3.47 ▲0.1750.85 ▼4.36
Posts /wp-admin/edit.php3.58 ▲0.2349.85 ▲6.06
Add New Post /wp-admin/post-new.php6.05 ▲0.1789.08 ▼12.68
Media Library /wp-admin/upload.php3.39 ▲0.1738.91 ▲3.52

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 152 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
avifoperationmode
can_compress_scripts
widget_theysaidso_widget
db_upgraded
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Avif Express
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,801 ▲4014.72 ▲0.381.62 ▼0.0442.88 ▼0.72
Dashboard /wp-admin2,201 ▲245.65 ▼0.0385.96 ▼5.2038.77 ▼3.24
Posts /wp-admin/edit.php2,112 ▲121.95 ▼0.0635.94 ▼0.6532.89 ▲1.30
Add New Post /wp-admin/post-new.php1,536 ▼123.61 ▲5.23705.25 ▲73.9262.98 ▲3.81
Media Library /wp-admin/upload.php1,409 ▲124.16 ▼0.0396.07 ▼7.4446.86 ▲5.06

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Zombie WordPress options were found after uninstall: 7 options
    • avifoperationmode
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts

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
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 49× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\CssSelector\\Exception\\ParseException' not found in wp-content/plugins/avif-express/core/vendor/symfony/css-selector/Exception/SyntaxErrorException.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Polyfill\\Php80\\PhpToken' not found in wp-content/plugins/avif-express/core/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\CssSelector\\Exception\\ExceptionInterface' not found in wp-content/plugins/avif-express/core/vendor/symfony/css-selector/Exception/ParseException.php:22
    • > PHP Fatal error
      Uncaught Error: Interface 'Stringable' not found in wp-content/plugins/avif-express/core/vendor/symfony/polyfill-php80/PhpToken.php:19
    • > PHP Fatal error
      require(): Failed opening required 'wp-content/plugins/avif-express/core/vendor/voku/simple_html_dom/build/../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/avif-express/core/vendor/voku/simple_html_dom/build/generate_docs.php on line 3
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\CssSelector\\Parser\\Handler\\HandlerInterface' not found in wp-content/plugins/avif-express/core/vendor/symfony/css-selector/Parser/Handler/NumberHandler.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\CssSelector\ode\\AbstractNode' not found in wp-content/plugins/avif-express/core/vendor/symfony/css-selector/Node/ClassNode.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'voku\\helper\\AbstractSimpleHtmlDom' not found in wp-content/plugins/avif-express/core/vendor/voku/simple_html_dom/src/voku/helper/SimpleHtmlDom.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'voku\\helper\\AbstractSimpleXmlDomNode' not found in wp-content/plugins/avif-express/core/vendor/voku/simple_html_dom/src/voku/helper/SimpleXmlDomNode.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\CssSelector\ode\\AbstractNode' not found in wp-content/plugins/avif-express/core/vendor/symfony/css-selector/Node/FunctionNode.php:26

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Requires php: Invalid version format
The official readme.txt is a good inspiration

avif-express/avif-express.php Passed 13 tests

The main PHP script in "Avif Express" version 2023.06.28 is automatically included on every request by WordPress
37 characters long description:
Convert Images to AVIF and serve them

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
Success! There were no dangerous files found in this plugin9,795 lines of code in 126 files:
LanguageFilesBlank linesComment linesLines of code
PHP1032,0065,5657,269
SVG4001,290
Markdown93481765
JSON600381
YAML214088
CSS1001
JavaScript1011

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity11.85
▷ Minimum class complexity1.00
▷ Maximum class complexity109.00
Average method complexity2.46
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces17
Interfaces13
Traits0
Classes79
▷ Abstract classes78.86%
▷ Concrete classes7291.14%
▷ Final classes56.94%
Methods821
▷ Static methods9411.45%
▷ Public methods77694.52%
▷ Protected methods303.65%
▷ Private methods151.83%
Functions25
▷ Named functions1040.00%
▷ Anonymous functions1560.00%
Constants36
▷ Global constants1541.67%
▷ Class constants2158.33%
▷ Public constants21100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
core/app/backend/assets/imgs/avif.png7.18KB3.61KB▼ 49.65%