68% c3-cloudfront-clear-cache

Code Review | C3 Cloudfront Cache Controller

WordPress plugin C3 Cloudfront Cache Controller scored68%from 54 tests.

About plugin

  • Plugin page: c3-cloudfront-cle...
  • Plugin version: 6.1.5
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Nov 27, 2015
  • Latest release: Mar 11, 2023
  • Number of updates: 77
  • Update frequency: every 34.6 days
  • Top authors: hideokamoto (96.1%)wokamoto (5.19%)

Code review

54 tests

User reviews

3 reviews

Install metrics

3,000+ active /162,830 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.49MB] [CPU: ▼4.83ms] Passed 4 tests

A check of server-side resources used by C3 Cloudfront Cache Controller
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.94 ▲0.4844.23 ▼1.01
Dashboard /wp-admin3.79 ▲0.4956.29 ▼0.62
Posts /wp-admin/edit.php3.84 ▲0.4851.82 ▼1.75
Add New Post /wp-admin/post-new.php6.37 ▲0.4993.81 ▼15.95
Media Library /wp-admin/upload.php3.71 ▲0.4942.91 ▲4.68

Server storage [IO: ▲30.22MB] [DB: ▲0.00MB] 67% from 3 tests

Input-output and database impact of this plugin
It is recommended to fix the following issues
  • Try to limit filesystem usage to 25MB (currently using 30.22MB)
Filesystem: 2,563 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for C3 Cloudfront Cache Controller
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.69 ▼0.681.89 ▲0.1146.04 ▲2.58
Dashboard /wp-admin2,213 ▲285.90 ▼0.00111.35 ▲1.6741.45 ▲1.02
Posts /wp-admin/edit.php2,090 ▲11.98 ▼0.0836.80 ▼6.2432.31 ▼4.95
Add New Post /wp-admin/post-new.php1,517 ▼617.40 ▼5.70625.04 ▲1.4353.17 ▲0.76
Media Library /wp-admin/upload.php1,395 ▲104.24 ▲0.0095.55 ▼4.3242.62 ▼4.89

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 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
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options

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 applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/c3-cloudfront-clear-cache/vendor/mtdowling/jmespath.php/bin/jp.php
  • 916× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\AwsClient' not found in wp-content/plugins/c3-cloudfront-clear-cache/vendor/aws/aws-sdk-php/src/Polly/PollyClient.php:32
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\ClientInterface' not found in wp-content/plugins/c3-cloudfront-clear-cache/vendor/guzzlehttp/guzzle/src/Client.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\Exception\\AwsException' not found in wp-content/plugins/c3-cloudfront-clear-cache/vendor/aws/aws-sdk-php/src/Appflow/Exception/AppflowException.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\Exception\\AwsException' not found in wp-content/plugins/c3-cloudfront-clear-cache/vendor/aws/aws-sdk-php/src/DynamoDb/Exception/DynamoDbException.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\Exception\\AwsException' not found in wp-content/plugins/c3-cloudfront-clear-cache/vendor/aws/aws-sdk-php/src/CloudTrailData/Exception/CloudTrailDataException.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\Exception\\AwsException' not found in wp-content/plugins/c3-cloudfront-clear-cache/vendor/aws/aws-sdk-php/src/CloudHSMV2/Exception/CloudHSMV2Exception.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\Exception\\AwsException' not found in wp-content/plugins/c3-cloudfront-clear-cache/vendor/aws/aws-sdk-php/src/FraudDetector/Exception/FraudDetectorException.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\AwsClient' not found in wp-content/plugins/c3-cloudfront-clear-cache/vendor/aws/aws-sdk-php/src/WorkSpaces/WorkSpacesClient.php:140
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\Exception\\AwsException' not found in wp-content/plugins/c3-cloudfront-clear-cache/vendor/aws/aws-sdk-php/src/DataExchange/Exception/DataExchangeException.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\Multipart\\AbstractUploadManager' not found in wp-content/plugins/c3-cloudfront-clear-cache/vendor/aws/aws-sdk-php/src/Multipart/AbstractUploader.php:10

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 Passed 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
3 plugin tags: cloudfront, aws, cdn

c3-cloudfront-clear-cache/c3-cloudfront-clear-cache.php Passed 13 tests

The entry point to "C3 Cloudfront Cache Controller" version 6.1.5 is a PHP file that has certain tags in its header comment area
50 characters long description:
Manage CloudFront Cache and provide some fixtures.

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Almost there! Just fix the following issues
  • Even if your plugin relies on executable files (for example a companion app), never distribute executable files with your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/c3-cloudfront-clear-cache/vendor/aws/aws-crt-php/run_tests.bat
58,764 lines of code in 2,534 files:
LanguageFilesBlank linesComment linesLines of code
PHP2,4639,05149,07851,355
Markdown261,38003,896
JSON16701,621
C1025089882
C/C++ Header210538441
YAML53065201
Bourne Shell3194176
reStructuredText1352959
GLSL117055
XML10024
m414422
Pascal151514
Bourne Again Shell15013
INI2003
DOS Batch1202

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity5.43
▷ Minimum class complexity1.00
▷ Maximum class complexity166.00
Average method complexity2.63
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces746
Interfaces63
Traits28
Classes1,067
▷ Abstract classes181.69%
▷ Concrete classes1,04998.31%
▷ Final classes595.62%
Methods3,136
▷ Static methods57518.34%
▷ Public methods2,31673.85%
▷ Protected methods1434.56%
▷ Private methods67721.59%
Functions637
▷ Named functions22535.32%
▷ Anonymous functions41264.68%
Constants284
▷ Global constants93.17%
▷ Class constants27596.83%
▷ Public constants26395.64%

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
No PNG images were found in this plugin