73% add-expires-headers

Code Review | Add Expires Headers & Optimized Minify

WordPress plugin Add Expires Headers & Optimized Minify scored73%from 54 tests.

About plugin

  • Plugin page: add-expires-headers
  • Plugin version: 2.8.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-6.4.1
  • WordPress version: 6.3.1
  • First release: Jul 3, 2019
  • Latest release: Nov 12, 2023
  • Number of updates: 60
  • Update frequency: every 26.6 days
  • Top authors: passionatebrains (100%)

Code review

54 tests

User reviews

13 reviews

Install metrics

5,000+ active /160,609 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

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

A check of server-side resources used by Add Expires Headers & Optimized Minify
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /5.71 ▲2.24243.28 ▲202.77
Dashboard /wp-admin3.93 ▲0.6349.62 ▲0.67
Posts /wp-admin/edit.php3.99 ▲0.6350.90 ▲2.88
Add New Post /wp-admin/post-new.php6.47 ▲0.5999.49 ▲9.81
Media Library /wp-admin/upload.php3.86 ▲0.6345.20 ▲10.12
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius4.1938.23

Server storage [IO: ▲4.27MB] [DB: ▲0.07MB] 67% from 3 tests

A short overview of filesystem and database impact
These are issues you should consider
  • The plugin illegally modified 1 file (1.67KB) outside of "wp-content/plugins/add-expires-headers/" and "wp-content/uploads/"
    • (modified) .htaccess
Filesystem: 243 new files
Database: no new tables, 10 new options
New WordPress options
fs_active_plugins
db_upgraded
fs_accounts
fs_debug_mode
widget_theysaidso_widget
widget_recent-posts
aeh_expires_headers_settings
can_compress_scripts
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Add Expires Headers & Optimized Minify
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲7114.58 ▲0.017.81 ▲6.0147.15 ▲1.22
Dashboard /wp-admin2,231 ▲515.57 ▼0.0795.38 ▼16.8174.91 ▲32.37
Posts /wp-admin/edit.php2,155 ▲552.00 ▼0.0046.75 ▲11.5637.22 ▲0.98
Add New Post /wp-admin/post-new.php1,713 ▲18422.15 ▼1.13685.83 ▼10.9855.58 ▼15.09
Media Library /wp-admin/upload.php1,445 ▲484.20 ▲0.02107.10 ▲7.8988.16 ▲45.41
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius1,1191.7025.8530.69

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/add-expires-headers/freemius/includes/class-freemius.php+8546
    Undefined property: stdClass::$plugins
  • Zombie WordPress options were found after uninstall: 10 options
    • aeh-last-cache-update
    • fs_accounts
    • widget_theysaidso_widget
    • fs_active_plugins
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • fs_debug_mode
    • 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
Good news, no errors were detected

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
The following issues need your attention
  • 7× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'MatthiasMullie\\Minify\\AEH\\Minify' not found in wp-content/plugins/add-expires-headers/libs/matthiasmullie/minify/src/CSS.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'MatthiasMullie\\Minify\\AEH\\Exceptions\\BasicException' not found in wp-content/plugins/add-expires-headers/libs/matthiasmullie/minify/src/Exceptions/IOException.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'MatthiasMullie\\Minify\\AEH\\Exceptions\\BasicException' not found in wp-content/plugins/add-expires-headers/libs/matthiasmullie/minify/src/Exceptions/FileImportException.php:19
    • > PHP Fatal error
      Uncaught Error: Interface 'MatthiasMullie\\PathConverter\\AEH\\ConverterInterface' not found in wp-content/plugins/add-expires-headers/libs/matthiasmullie/path-converter/src/Converter.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'MatthiasMullie\\Minify\\AEH\\Minify' not found in wp-content/plugins/add-expires-headers/libs/matthiasmullie/minify/src/JS.php:24
    • > PHP Fatal error
      Uncaught Error: Interface 'MatthiasMullie\\PathConverter\\AEH\\ConverterInterface' not found in wp-content/plugins/add-expires-headers/libs/matthiasmullie/path-converter/src/NoConverter.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'MatthiasMullie\\Minify\\AEH\\Exception' not found in wp-content/plugins/add-expires-headers/libs/matthiasmullie/minify/src/Exceptions/BasicException.php:21

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 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Please fix the following attributes:
  • Tags: There are too many tags (19 tag instead of maximum 10)
You can take inspiration from this readme.txt

add-expires-headers/add-expires-headers.php 92% from 13 tests

The main PHP file in "Add Expires Headers & Optimized Minify" ver. 2.8.1 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 198 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected37,174 lines of code in 168 files:
LanguageFilesBlank linesComment linesLines of code
PHP1448,56118,54636,488
JavaScript64869307
Markdown1680214
CSS17014165

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
It is recommended to fix the following
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 3,096)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity71.50
▷ Minimum class complexity1.00
▷ Maximum class complexity3,096.00
Average method complexity4.56
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces3
Interfaces2
Traits0
Classes68
▷ Abstract classes68.82%
▷ Concrete classes6291.18%
▷ Final classes00.00%
Methods1,421
▷ Static methods20314.29%
▷ Public methods96868.12%
▷ Protected methods624.36%
▷ Private methods39127.52%
Functions115
▷ Named functions10187.83%
▷ Anonymous functions1412.17%
Constants153
▷ Global constants10568.63%
▷ Class constants4831.37%
▷ Public constants48100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
5 PNG files occupy 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assests/images/5-stars.png3.63KB2.25KB▼ 37.92%
assests/images/AddExpiresHeaders.png6.11KB2.86KB▼ 53.27%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
assests/images/AddExpiresHeadersFevicon.png2.90KB0.79KB▼ 72.70%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%