78% wp-cloudflare-page-cache

Code Review | Super Page Cache for Cloudflare

WordPress plugin Super Page Cache for Cloudflare scored78%from 54 tests.

About plugin

  • Plugin page: wp-cloudflare-pag...
  • Plugin version: 4.7.5
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.3
  • WordPress version: 6.3.1
  • First release: Feb 20, 2019
  • Latest release: Oct 30, 2023
  • Number of updates: 215
  • Update frequency: every 8.0 days
  • Top authors: salvatorefresta (85.12%)optimole (15.35%)

Code review

54 tests

User reviews

350 reviews

Install metrics

40,000+ active /697,329 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲2.73MB] [CPU: ▲10.38ms] Passed 4 tests

Analyzing server-side resources used by Super Page Cache for Cloudflare
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /6.21 ▲2.7555.39 ▲12.75
Dashboard /wp-admin6.07 ▲2.7761.41 ▲12.73
Posts /wp-admin/edit.php6.11 ▲2.7558.90 ▲8.57
Add New Post /wp-admin/post-new.php8.61 ▲2.7295.49 ▲7.47
Media Library /wp-admin/upload.php5.92 ▲2.6957.15 ▲22.40
Super Page Cache for Cloudflare Nginx Settings /wp-admin/admin.php?page=wp-cloudflare-super-page-cache-nginx-settings5.8946.41
Super Page Cache for Cloudflare /wp-admin/options-general.php?page=wp-cloudflare-super-page-cache-index7.3056.62
Super Page Cache for Cloudflare cached HTML pages /wp-admin/admin.php?page=wp-cloudflare-super-page-cache-cached-html-pages5.8944.89
Settings /wp-admin/admin.php?page=wp-cloudflare-super-page-cache-index7.3052.54

Server storage [IO: ▲2.59MB] [DB: ▲0.39MB] 67% from 3 tests

How much does this plugin use your filesystem and database?
Just a few items left to fix
  • The plugin illegally modified 5 files (0.10KB) outside of "wp-content/plugins/wp-cloudflare-page-cache/" and "wp-content/uploads/"
    • (new file) wp-content/wp-cloudflare-super-page-cache/wp.com/index.php
    • (new file) wp-content/wp-cloudflare-super-page-cache/index.php
    • (new file) wp-content/wp-cloudflare-super-page-cache/wp.com/cached_html_pages/index.php
    • (new file) wp-content/wp-cloudflare-super-page-cache/wp.com/purge_cache_queue/index.php
    • (new file) wp-content/wp-cloudflare-super-page-cache/wp.com/nginx.conf
Filesystem: 97 new files
Database: no new tables, 9 new options
New WordPress options
widget_theysaidso_widget
swcfpc_version
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
db_upgraded
widget_recent-comments
swcfpc_config
wp_cloudflare_page_cache_install

Browser metrics Passed 4 tests

A check of browser resources used by Super Page Cache for Cloudflare
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,967 ▲20614.69 ▲0.342.29 ▲0.6031.60 ▼11.44
Dashboard /wp-admin2,344 ▲1735.66 ▼0.0283.43 ▼16.6343.66 ▼1.11
Posts /wp-admin/edit.php2,134 ▲342.23 ▲0.2434.46 ▼1.9435.81 ▲1.71
Add New Post /wp-admin/post-new.php1,548 ▲2022.99 ▼0.05621.26 ▼104.0460.08 ▲4.91
Media Library /wp-admin/upload.php1,427 ▲304.34 ▲0.1598.01 ▼8.0842.23 ▼0.18
Super Page Cache for Cloudflare Nginx Settings /wp-admin/admin.php?page=wp-cloudflare-super-page-cache-nginx-settings8421.8622.8330.29
Super Page Cache for Cloudflare /wp-admin/options-general.php?page=wp-cloudflare-super-page-cache-index5,0981.8528.0051.83
Super Page Cache for Cloudflare cached HTML pages /wp-admin/admin.php?page=wp-cloudflare-super-page-cache-cached-html-pages8291.9027.9523.15
Settings /wp-admin/admin.php?page=wp-cloudflare-super-page-cache-index5,0951.8527.3139.04

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-comments
    • wp_cloudflare_page_cache_install
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded

Smoke tests 50% 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 0% 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
  • 11× GET requests to PHP files return non-empty strings (only 10 are shown):
    • > /wp-content/plugins/wp-cloudflare-page-cache/libs/cloudflare.class.php
    • > /wp-content/plugins/wp-cloudflare-page-cache/libs/backend.class.php
    • > /wp-content/plugins/wp-cloudflare-page-cache/libs/fallback_cache.class.php
    • > /wp-content/plugins/wp-cloudflare-page-cache/libs/wpcli.class.php
    • > /wp-content/plugins/wp-cloudflare-page-cache/libs/installer.class.php
    • > /wp-content/plugins/wp-cloudflare-page-cache/libs/logs.class.php
    • > /wp-content/plugins/wp-cloudflare-page-cache/libs/varnish.class.php
    • > /wp-content/plugins/wp-cloudflare-page-cache/assets/advanced-cache.php
    • > /wp-content/plugins/wp-cloudflare-page-cache/libs/preloader.class.php
    • > /wp-content/plugins/wp-cloudflare-page-cache/libs/cache_controller.class.php
  • 7× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/wp-cloudflare-page-cache/wp-cloudflare-super-page-cache.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_thickbox() in wp-content/plugins/wp-cloudflare-page-cache/libs/views/sidebar.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Async_Request' not found in wp-content/plugins/wp-cloudflare-page-cache/vendor/deliciousbrains/wp-background-processing/classes/wp-background-process.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/wp-cloudflare-page-cache/vendor/deliciousbrains/wp-background-processing/wp-background-processing.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wp-cloudflare-page-cache/libs/views/cached_html_pages.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wp-cloudflare-page-cache/libs/views/nginx.php:5
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/wp-cloudflare-page-cache/libs/views/settings.php:5

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 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
4 plugin tags: cloudflare cache, improve speed, improve performance, page caching

wp-cloudflare-page-cache/wp-cloudflare-super-page-cache.php 92% from 13 tests

"Super Page Cache for Cloudflare" version 4.7.5's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("wp-cloudflare-page-cache.php" instead of "wp-cloudflare-super-page-cache.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin22,383 lines of code in 76 files:
LanguageFilesBlank linesComment linesLines of code
PHP545,2165,39812,956
JavaScript109411,7275,854
CSS6120122,277
PO File1306438884
Markdown22120275
JSON10095
SVG10031
HTML10011

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Please fix the following
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 212)
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity62.82
▷ Minimum class complexity1.00
▷ Maximum class complexity547.00
Average method complexity4.79
▷ Minimum method complexity1.00
▷ Maximum method complexity212.00
Code structure
Namespaces5
Interfaces0
Traits0
Classes34
▷ Abstract classes38.82%
▷ Concrete classes3191.18%
▷ Final classes13.23%
Methods550
▷ Static methods519.27%
▷ Public methods47486.18%
▷ Protected methods213.82%
▷ Private methods5510.00%
Functions49
▷ Named functions2346.94%
▷ Anonymous functions2653.06%
Constants30
▷ Global constants1550.00%
▷ Class constants1550.00%
▷ Public constants15100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
7 PNG files occupy 0.29MB with 0.10MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/codeinwp/themeisle-sdk/assets/images/sparks.png2.63KB1.34KB▼ 49.07%
vendor/codeinwp/themeisle-sdk/assets/images/wplk.png1.92KB1.27KB▼ 33.69%
vendor/codeinwp/themeisle-sdk/assets/images/otter/otter-library.png173.18KB173.42KB0.00%
vendor/codeinwp/themeisle-sdk/assets/images/otter/otter-patterns.png87.50KB87.41KB0.10%
assets/img/partners/cloudways.png4.83KB0.32KB▼ 93.38%