10% edge-cache-html-cloudflare-workers

Code Review | Edge Cache HTML via Cloudflare Workers

WordPress plugin Edge Cache HTML via Cloudflare Workers scored10%from 54 tests.

About plugin

  • Plugin page: edge-cache-html-c...
  • Plugin version: 1.0.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3.1-5.3.2
  • WordPress version: 6.3.1
  • First release: Dec 7, 2019
  • Latest release: Jan 28, 2020
  • Number of updates: 13
  • Update frequency: every 4.1 days
  • Top authors: s1lviu (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

200+ active /5,577 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
These installer errors require your attention
  • Install procedure validation failed for this plugin
    • > Notice in wp-content/plugins/edge-cache-html-cloudflare-workers/admin/class-cloudflare-edge-cache-admin-settings.php+56
    Trying to access array offset on value of type bool

Server metrics [RAM: ▼1.79MB] [CPU: ▼54.57ms] Passed 4 tests

A check of server-side resources used by Edge Cache HTML via Cloudflare Workers
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.20 ▼1.266.00 ▼34.15
Dashboard /wp-admin2.22 ▼1.087.66 ▼44.97
Posts /wp-admin/edit.php2.22 ▼1.146.37 ▼36.83
Add New Post /wp-admin/post-new.php2.22 ▼3.677.83 ▼102.32
Media Library /wp-admin/upload.php2.22 ▼1.016.95 ▼29.95
Cloudflare Edge Caching Options /wp-admin/plugins.php?page=cf_caching_options2.237.52

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 22 new files
Database: no new tables, 8 new options
New WordPress options
cf_edge_cache_input
widget_recent-posts
widget_recent-comments
cf_edge_cache_options
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Edge Cache HTML via Cloudflare Workers
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,880 ▲9413.50 ▼0.858.24 ▲6.1443.00 ▼3.17
Dashboard /wp-admin2,203 ▲235.65 ▲0.0585.36 ▼12.9041.50 ▼1.27
Posts /wp-admin/edit.php2,108 ▲82.01 ▲0.0237.10 ▼2.1832.33 ▼0.99
Add New Post /wp-admin/post-new.php1,542 ▲1618.19 ▼4.89640.83 ▲17.6652.06 ▲1.34
Media Library /wp-admin/upload.php1,408 ▲144.23 ▲0.0396.25 ▲0.7343.33 ▲2.26
Cloudflare Edge Caching Options /wp-admin/plugins.php?page=cf_caching_options8372.0422.7139.10

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
You still need to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/edge-cache-html-cloudflare-workers/admin/class-cloudflare-edge-cache-admin-settings.php+57
    Undefined index: cloudflare_api_key
  • This plugin does not fully uninstall, leaving 8 options in the database
    • cf_edge_cache_options
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • cf_edge_cache_input
    • widget_recent-posts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These server-side errors were triggered
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/plugins.php?page=cf_caching_options
    • > Notice in wp-content/plugins/edge-cache-html-cloudflare-workers/admin/class-cloudflare-edge-cache-admin-settings.php+328
    Undefined index: cloudflare_api_key

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
Almost there! Just fix the following items
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/edge-cache-html-cloudflare-workers/admin/partials/cloudflare-edge-cache-admin-display.php
    • > /wp-content/plugins/edge-cache-html-cloudflare-workers/public/partials/cloudflare-edge-cache-public-display.php

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 90% 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: caching, cloudflare cache, cloudflare workers, workers

edge-cache-html-cloudflare-workers/cloudflare-edge-cache.php 77% from 13 tests

"Edge Cache HTML via Cloudflare Workers" version 1.0.5's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Domain Path: The domain path points to a folder that does not exist ("/languages")
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("edge-cache-html-cloudflare-workers.php" instead of "cloudflare-edge-cache.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin641 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP12187628579
CSS24842
JavaScript295620

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.11
Average class complexity4.14
▷ Minimum class complexity1.00
▷ Maximum class complexity15.00
Average method complexity1.46
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods48
▷ Static methods24.17%
▷ Public methods4389.58%
▷ Protected methods00.00%
▷ Private methods510.42%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.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
There were not PNG files found in your plugin