84% prevent-browser-caching

Code Review | Prevent Browser Caching

WordPress plugin Prevent Browser Caching scored84%from 54 tests.

About plugin

  • Plugin page: prevent-browser-c...
  • Plugin version: 2.3.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.3
  • WordPress version: 6.3.1
  • First release: Oct 30, 2017
  • Latest release: Sep 25, 2023
  • Number of updates: 51
  • Update frequency: every 42.3 days
  • Top authors: kostyatereshchuk (100%)

Code review

54 tests

User reviews

25 reviews

Install metrics

10,000+ active /75,674 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 gracefully, with no errors

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

This is a short check of server-side resources used by Prevent Browser Caching
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0145.75 ▲4.38
Dashboard /wp-admin3.32 ▼0.0247.99 ▼18.46
Posts /wp-admin/edit.php3.37 ▲0.0249.57 ▼4.21
Add New Post /wp-admin/post-new.php5.90 ▲0.0285.31 ▼10.78
Media Library /wp-admin/upload.php3.24 ▲0.0234.84 ▼1.80
Prevent Browser Caching /wp-admin/options-general.php?page=prevent-browser-caching3.2133.09

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Prevent Browser Caching
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲2214.73 ▲0.322.23 ▼0.0644.57 ▼2.46
Dashboard /wp-admin2,199 ▲255.56 ▼0.0787.83 ▼10.6842.00 ▼1.87
Posts /wp-admin/edit.php2,104 ▲41.99 ▼0.0133.76 ▼10.6436.65 ▲1.48
Add New Post /wp-admin/post-new.php1,531 ▲223.18 ▲0.05675.50 ▲62.4372.33 ▲18.78
Media Library /wp-admin/upload.php1,401 ▼24.18 ▼0.0699.07 ▼2.7339.54 ▼7.26
Prevent Browser Caching /wp-admin/options-general.php?page=prevent-browser-caching8451.6929.5727.28

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check 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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/prevent-browser-caching/includes/class-prevent-browser-caching.php:169
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/prevent-browser-caching/includes/admin/class-prevent-browser-caching-admin-settings.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: A description for screenshot #1 is required in prevent-browser-caching/assets to your readme.txt
  • Contributors: The plugin contributors field is missing
You can look at the official readme.txt

prevent-browser-caching/prevent-browser-caching.php Passed 13 tests

The entry point to "Prevent Browser Caching" version 2.3.4 is a PHP file that has certain tags in its header comment area
138 characters long description:
Updates the assets version of all CSS and JS files. Shows the latest changes on the site without asking the client to clear browser cache.

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
There were no executable files found in this plugin375 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP496156375

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity12.00
▷ Minimum class complexity4.00
▷ Maximum class complexity25.00
Average method complexity2.50
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods22
▷ Static methods29.09%
▷ Public methods22100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There were not PNG files found in your plugin