78% app-for-cf

Code Review | App for Cloudflare®

WordPress plugin App for Cloudflare® scored78%from 54 tests.

About plugin

  • Plugin page: app-for-cf
  • Plugin version: 1.8.1
  • PHP compatiblity: 5.4.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.4
  • WordPress version: 6.3.1
  • First release: Oct 5, 2023
  • Latest release: Dec 2, 2023
  • Number of updates: 10
  • Update frequency: every 5.9 days
  • Top authors: digitalpoint (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

80+ active /827 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.68MB] [CPU: ▼3.22ms] Passed 4 tests

Analyzing server-side resources used by App for Cloudflare®
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.15 ▲0.6944.36 ▲2.10
Dashboard /wp-admin3.99 ▲0.6446.47 ▼9.09
Posts /wp-admin/edit.php4.39 ▲1.0352.30 ▲3.46
Add New Post /wp-admin/post-new.php6.62 ▲0.7388.27 ▼9.36
Media Library /wp-admin/upload.php3.88 ▲0.6538.48 ▲3.49
IP address details /wp-admin/admin.php?page=app-for-cf_ip-details3.9637.49
Firewall /wp-admin/admin.php?page=app-for-cf_firewall4.5546.42
R2 (media storage) /wp-admin/admin.php?page=app-for-cf_r23.9635.31
WHOIS /wp-admin/admin.php?page=app-for-cf_whois3.9636.27
Settings Missing API token /wp-admin/options-general.php?page=app-for-cf4.2437.75
DMARC management /wp-admin/admin.php?page=app-for-cf_dmarc4.5341.89
Rules /wp-admin/admin.php?page=app-for-cf_rules4.5344.34
Cloudflare Settings /wp-admin/admin.php?page=app-for-cf_settings4.2337.45
Public page caching /wp-admin/admin.php?page=app-for-cf_caching4.6337.57
Domain details /wp-admin/admin.php?page=app-for-cf_domain-details3.9635.07

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 64 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
db_upgraded
theysaidso_admin_options
app_for_cf
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

App for Cloudflare®: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,866 ▲9414.16 ▼0.131.53 ▼0.7236.69 ▼6.99
Dashboard /wp-admin2,274 ▲965.59 ▼0.1494.96 ▼14.8641.96 ▼0.93
Posts /wp-admin/edit.php2,176 ▲762.01 ▲0.0638.91 ▼1.0736.94 ▲1.21
Add New Post /wp-admin/post-new.php1,587 ▲5623.14 ▲0.26667.69 ▲6.7452.44 ▲0.21
Media Library /wp-admin/upload.php1,540 ▲1434.18 ▼0.1197.07 ▲3.4849.91 ▲7.23
IP address details /wp-admin/admin.php?page=app-for-cf_ip-details8802.0527.6129.27
Firewall /wp-admin/admin.php?page=app-for-cf_firewall9981.8225.9527.39
R2 (media storage) /wp-admin/admin.php?page=app-for-cf_r29691.8224.5526.60
WHOIS /wp-admin/admin.php?page=app-for-cf_whois8872.0226.1928.20
Settings Missing API token /wp-admin/options-general.php?page=app-for-cf1,3082.0535.3944.91
DMARC management /wp-admin/admin.php?page=app-for-cf_dmarc9753.2474.8334.20
Rules /wp-admin/admin.php?page=app-for-cf_rules9461.8226.4427.89
Cloudflare Settings /wp-admin/admin.php?page=app-for-cf_settings1,2512.0634.8536.42
Public page caching /wp-admin/admin.php?page=app-for-cf_caching9501.7924.4731.01
Domain details /wp-admin/admin.php?page=app-for-cf_domain-details8872.0224.8826.10

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 7 options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • app_for_cf
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=app-for-cf_dmarc
    • > Notice in wp-content/plugins/app-for-cf/src/DigitalPoint/Cloudflare/Admin/Controller/Cloudflare.php+586
    Undefined offset: 0
    • > GET request to /wp-admin/admin.php?page=app-for-cf_dmarc
    • > POST request to /wp-admin/admin-ajax.php
    • > Notice in wp-content/plugins/app-for-cf/src/DigitalPoint/Cloudflare/Admin/Controller/Cloudflare.php+193
    Undefined index: stats

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 32× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'DigitalPoint\\Cloudflare\\Admin\\Template\\AbstractTemplate' not found in wp-content/plugins/app-for-cf/src/DigitalPoint/Cloudflare/Admin/Template/MultisiteR2.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'DigitalPoint\\Cloudflare\\Admin\\Template\\AbstractTemplate' not found in wp-content/plugins/app-for-cf/src/DigitalPoint/Cloudflare/Admin/Template/Dmarc.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'DigitalPoint\\Cloudflare\\Admin\\Template\\AbstractTemplate' not found in wp-content/plugins/app-for-cf/src/DigitalPoint/Cloudflare/Admin/Template/Firewall.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'DigitalPoint\\Cloudflare\\Format\\Table\\AbstractTable' not found in wp-content/plugins/app-for-cf/src/DigitalPoint/Cloudflare/Format/Table/Dmarc.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'DigitalPoint\\Cloudflare\\Admin\\Template\\AbstractTemplate' not found in wp-content/plugins/app-for-cf/src/DigitalPoint/Cloudflare/Admin/Template/Cache.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'DigitalPoint\\Cloudflare\\Admin\\Template\\AbstractTemplate' not found in wp-content/plugins/app-for-cf/src/DigitalPoint/Cloudflare/Admin/Template/Dashboard.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'DigitalPoint\\Cloudflare\\Admin\\Template\\AbstractTemplate' not found in wp-content/plugins/app-for-cf/src/DigitalPoint/Cloudflare/Admin/Template/Settings.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'DigitalPoint\\Cloudflare\\Admin\\Template\\AbstractTemplate' not found in wp-content/plugins/app-for-cf/src/DigitalPoint/Cloudflare/Admin/Template/Rules.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'DigitalPoint\\Cloudflare\\Format\\Table\\AbstractTable' not found in wp-content/plugins/app-for-cf/src/DigitalPoint/Cloudflare/Format/Table/RequestTrace.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'XF\\Mvc\\Entity\\Repository' not found in wp-content/plugins/app-for-cf/src/DigitalPoint/Cloudflare/Repository/Cloudflare.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% 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
8 plugin tags: cache, cloudflare, performance, caching, security...

app-for-cf/app-for-cf.php 85% from 13 tests

The main PHP script in "App for Cloudflare®" version 1.8.1 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 325 characters long)
  • Domain Path: The domain path folder was not found ("/languages/")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected9,334 lines of code in 62 files:
LanguageFilesBlank linesComment linesLines of code
PHP511,2362968,101
CSS417714739
JavaScript78531494

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity16.73
▷ Minimum class complexity1.00
▷ Maximum class complexity186.00
Average method complexity3.78
▷ Minimum method complexity1.00
▷ Maximum method complexity33.00
Code structure
Namespaces19
Interfaces0
Traits3
Classes53
▷ Abstract classes815.09%
▷ Concrete classes4584.91%
▷ Final classes00.00%
Methods337
▷ Static methods3410.09%
▷ Public methods18554.90%
▷ Protected methods15245.10%
▷ Private methods00.00%
Functions2
▷ Named functions00.00%
▷ Anonymous functions2100.00%
Constants7
▷ Global constants7100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected