83% clear-sucuri-cache

Code Review | Clear Sucuri Cache

WordPress plugin Clear Sucuri Cache scored 83% from 54 tests.

About plugin

  • Plugin page: clear-sucuri-cache
  • Plugin version: 1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-4.8.2
  • WordPress version: 6.3.1
  • First release: Jan 30, 2017
  • Latest release: Oct 9, 2017
  • Number of updates: 11
  • Update frequency: every 22.6 days
  • Top authors: webrangers (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

1,000+ active / 6,310 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.08MB] [CPU: ▼4.03ms] Passed 4 tests

This is a short check of server-side resources used by Clear Sucuri Cache
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0837.76 ▼3.67
Dashboard /wp-admin3.38 ▲0.0843.94 ▼1.53
Posts /wp-admin/edit.php3.50 ▲0.1446.96 ▼5.47
Add New Post /wp-admin/post-new.php5.98 ▲0.1094.89 ▼5.46
Media Library /wp-admin/upload.php3.31 ▲0.0838.82 ▲2.26

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 8 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
sucuri-clearr
db_upgraded
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

Clear Sucuri Cache: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,981 ▲22413.66 ▼0.599.00 ▲6.5840.92 ▼1.84
Dashboard /wp-admin2,276 ▲855.88 ▲0.9299.60 ▼16.3079.71 ▲39.23
Posts /wp-admin/edit.php2,159 ▲672.02 ▼0.0238.81 ▼0.9836.35 ▲1.17
Add New Post /wp-admin/post-new.php1,746 ▲21624.95 ▲6.79636.64 ▼3.9946.77 ▼7.60
Media Library /wp-admin/upload.php1,458 ▲704.23 ▼0.0799.82 ▲1.2579.76 ▲37.43

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • 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
Please fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/clear-sucuri-cache/purge-sucuri.php

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Tags: You are using too many tags: 11 tag instead of maximum 10
The official readme.txt is a good inspiration

clear-sucuri-cache/purge-sucuri.php 85% from 13 tests

The main PHP file in "Clear Sucuri Cache" ver. 1.4 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("clear-sucuri-cache.php" instead of "purge-sucuri.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

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
There were no executable files found in this plugin610 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP351129293
CSS1262218
JavaScript115599

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity33.00
▷ Minimum class complexity33.00
▷ Maximum class complexity33.00
Average method complexity2.39
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods23
▷ Static methods417.39%
▷ Public methods23100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants342.86%
▷ Class constants457.14%
▷ Public constants4100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
2 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/spinner.png0.41KB0.33KB▼ 20.28%
images/icon.png0.57KB0.51KB▼ 10.75%