10% cloudflare-cache-purge

Code Review | CloudFlare(R) Cache Purge

WordPress plugin CloudFlare(R) Cache Purge scored10%from 54 tests.

About plugin

  • Plugin page: cloudflare-cache-...
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.2
  • WordPress version: 6.3.1
  • First release: Apr 1, 2013
  • Latest release: Apr 14, 2015
  • Number of updates: 13
  • Update frequency: every 57.2 days
  • Top authors: shanaver (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

200+ active /13,389 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Please fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Notice in wp-content/plugins/cloudflare-cache-purge/cloudflare_cachepurge.php+80
    Undefined index: ccpurge_logging_disabled

Server metrics [RAM: ▲0.07MB] [CPU: ▼3.06ms] Passed 4 tests

A check of server-side resources used by CloudFlare(R) Cache Purge
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0941.26 ▲0.56
Dashboard /wp-admin3.39 ▲0.0451.79 ▼14.77
Posts /wp-admin/edit.php3.50 ▲0.1453.50 ▲5.12
Add New Post /wp-admin/post-new.php5.97 ▲0.08102.09 ▲0.35
Media Library /wp-admin/upload.php3.31 ▲0.0836.74 ▲1.63
Cloudflare Purge /wp-admin/options-general.php?page=ccpurge3.2934.08

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 9 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
ccpurge_options

Browser metrics Passed 4 tests

An overview of browser requirements for CloudFlare(R) Cache Purge
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,809 ▲6313.37 ▼0.931.93 ▼0.0942.15 ▼0.25
Dashboard /wp-admin2,212 ▲245.92 ▼0.09120.13 ▲12.4842.42 ▲2.01
Posts /wp-admin/edit.php2,101 ▲122.07 ▲0.0243.86 ▲5.6635.69 ▼2.00
Add New Post /wp-admin/post-new.php1,521 ▲723.06 ▲5.46668.48 ▼25.5157.66 ▲6.10
Media Library /wp-admin/upload.php1,400 ▲154.38 ▲0.18109.89 ▲2.8343.30 ▼6.75
Cloudflare Purge /wp-admin/options-general.php?page=ccpurge9282.1335.1337.78

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/cloudflare-cache-purge/cloudflare_cachepurge.php+80
    Undefined index: ccpurge_logging_disabled
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-comments
    • ccpurge_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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 take a closer look at the following
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'CCPURGE_API' not found in wp-content/plugins/cloudflare-cache-purge/lib/ccpurge_options.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cloudflare-cache-purge/lib/ccpurge_posttypes.php:27
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/cloudflare-cache-purge/cloudflare_cachepurge.php:21

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
4 plugin tags: cache clear, cache purge, api, cloudflare

cloudflare-cache-purge/cloudflare_cachepurge.php 92% from 13 tests

The main file in "CloudFlare(R) Cache Purge" v. 1.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("cloudflare-cache-purge.php" instead of "cloudflare_cachepurge.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin562 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP49446395
JavaScript114099
CSS16268

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity23.00
▷ Minimum class complexity23.00
▷ Maximum class complexity23.00
Average method complexity3.44
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods00.00%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
lib/tooltip.png0.72KB0.67KB▼ 7.69%