84% far-future-expiry-header

Code Review | Far Future Expiry Header

WordPress plugin Far Future Expiry Header scored84%from 54 tests.

About plugin

  • Plugin page: far-future-expiry...
  • Plugin version: 1.6
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-6.3
  • WordPress version: 6.3.1
  • First release: Mar 6, 2014
  • Latest release: Jul 25, 2023
  • Number of updates: 35
  • Update frequency: every 98.1 days
  • Top authors: mra13 (100%)

Code review

54 tests

User reviews

29 reviews

Install metrics

10,000+ active /217,029 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
Installer ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼2.38ms] Passed 4 tests

Server-side resources used by Far Future Expiry Header
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0547.90 ▲0.11
Dashboard /wp-admin3.35 ▲0.0554.14 ▼0.71
Posts /wp-admin/edit.php3.40 ▲0.0552.31 ▲2.82
Add New Post /wp-admin/post-new.php5.93 ▲0.0590.68 ▼11.75
Media Library /wp-admin/upload.php3.28 ▲0.0539.55 ▲3.71
FarFutureExpiry /wp-admin/options-general.php?page=ffe_plugin_options3.2733.85

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Far Future Expiry Header
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5814.79 ▲0.421.84 ▲0.0543.92 ▼7.97
Dashboard /wp-admin2,213 ▲254.81 ▼1.10113.40 ▲2.5449.35 ▲6.56
Posts /wp-admin/edit.php2,093 ▲42.00 ▼0.0236.59 ▼7.2135.61 ▲0.56
Add New Post /wp-admin/post-new.php1,530 ▼318.62 ▼4.46664.85 ▼31.8549.81 ▼10.41
Media Library /wp-admin/upload.php1,395 ▲74.21 ▲0.0195.23 ▼14.5644.47 ▼1.85
FarFutureExpiry /wp-admin/options-general.php?page=ffe_plugin_options9692.1726.6824.57

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
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • 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
Even though no errors were found, this is by no means an exhaustive test

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 fix the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/far-future-expiry-header/far-future-expiration.php:36

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

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need your attention:
  • Tags: Too many tags (12 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

far-future-expiry-header/far-future-expiration.php 92% from 13 tests

"Far Future Expiry Header" version 1.6's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("far-future-expiry-header.php" instead of "far-future-expiration.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected407 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP25756407

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.51
Average class complexity40.00
▷ Minimum class complexity40.00
▷ Maximum class complexity40.00
Average method complexity3.79
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods14
▷ Static methods00.00%
▷ Public methods14100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG images were found in this plugin