94% last-modified-and-if-modified-since-headers

Code Review | Last-Modified and If-Modified-Since Headers

WordPress plugin Last-Modified and If-Modified-Since Headers scored 94% from 54 tests.

About plugin

  • Plugin page: last-modified-and...
  • Plugin version: 1.0
  • PHP compatiblity: 5.3++
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2.4-5.7.1
  • WordPress version: 5.8.1
  • First release: Jul 20, 2021
  • Latest release: Jul 20, 2021
  • Number of updates: 3
  • Update frequency: every 0.3 days
  • Top authors: zubovd (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active / 143 total downloads

Benchmarks

Plugin footprint Passed 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.00MB] [CPU: ▼143.39ms] Passed 4 tests

A check of server-side resources used by Last-Modified and If-Modified-Since Headers
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.85 ▲0.1236.62 ▲14.02
Dashboard /wp-admin3.07 ▲0.0144.61 ▼11.45
Posts /wp-admin/edit.php3.12 ▲0.0146.93 ▼2.25
Add New Post /wp-admin/post-new.php5.43 ▼0.0198.25 ▼555.53
Media Library /wp-admin/upload.php3.01 ▲0.0127.64 ▼4.34

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 2 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Last-Modified and If-Modified-Since Headers
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,679 ▲8315.88 ▲0.0110.04 ▼0.5653.51 ▼0.11
Dashboard /wp-admin2,973 ▲425.89 ▼0.02146.48 ▼2.47124.18 ▲3.41
Posts /wp-admin/edit.php2,739 ▼02.68 ▼0.0168.24 ▼6.9095.02 ▲1.48
Add New Post /wp-admin/post-new.php1,594 ▼8918.78 ▲0.42405.45 ▲3.83115.94 ▲0.09
Media Library /wp-admin/upload.php1,807 ▼04.98 ▼0.05150.87 ▼3.71131.05 ▲10.82

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check 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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/last-modified-and-if-modified-since-headers/last-modified-and-if-modified-since-headers.php:15

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 to be fixed:
  • Requires php: Invalid plugin version format
You can look at the official readme.txt

last-modified-and-if-modified-since-headers/last-modified-and-if-modified-since-headers.php 92% from 13 tests

The primary PHP file in "Last-Modified and If-Modified-Since Headers" version 1.0 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Requires PHP: Required version number formatted incorrectly (ex. "7.0" instead of "5.3+")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected21 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP151221

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.60
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG images were found in this plugin