83% ct-optimization

Code Review | CT Optimization

WordPress plugin CT Optimization scored83%from 54 tests.

About plugin

  • Plugin page: ct-optimization
  • Plugin version: 1.0.16
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.1
  • WordPress version: 6.3.1
  • First release: Dec 26, 2020
  • Latest release: Dec 23, 2022
  • Number of updates: 18
  • Update frequency: every 40.4 days
  • Top authors: codetot (100%)

Code review

54 tests

User reviews

1 review

Install metrics

80+ active /1,063 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.28MB] [CPU: ▼8.29ms] Passed 4 tests

Analyzing server-side resources used by CT Optimization
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.73 ▲0.2736.73 ▼0.66
Dashboard /wp-admin3.66 ▲0.3147.11 ▼21.83
Posts /wp-admin/edit.php3.71 ▲0.3548.86 ▲0.80
Add New Post /wp-admin/post-new.php6.17 ▲0.2884.69 ▼11.45
Media Library /wp-admin/upload.php3.52 ▲0.2836.44 ▲2.46

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

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

Browser metrics Passed 4 tests

CT Optimization: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,805 ▲4414.31 ▼0.311.65 ▲0.0437.16 ▼5.27
Dashboard /wp-admin2,211 ▲345.52 ▼0.1783.30 ▼3.2338.00 ▼0.02
Posts /wp-admin/edit.php2,116 ▲161.97 ▼0.0333.81 ▼5.1933.69 ▼3.41
Add New Post /wp-admin/post-new.php1,539 ▲1122.87 ▼0.22593.61 ▼149.8254.11 ▼12.90
Media Library /wp-admin/upload.php1,416 ▲194.21 ▼0.0293.50 ▼5.9643.74 ▼0.55

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

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
The following issues need your attention
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Warning
      Use of undefined constant CODETOT_OPTIMIZATION_PATH - assumed 'CODETOT_OPTIMIZATION_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/ct-optimization/admin/class-codetot-optimization-admin.php on line 10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/ct-optimization/admin/partials/display.php:14
    • > PHP Warning
      require_once(CODETOT_OPTIMIZATION_PATH/includes/class-codetot-admin-options-page.php): failed to open stream: No such file or directory in wp-content/plugins/ct-optimization/admin/class-codetot-optimization-admin.php on line 10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/ct-optimization/includes/class-codetot-optimization-assets.php:40
    • > PHP Fatal error
      require_once(): Failed opening required 'CODETOT_OPTIMIZATION_PATH/includes/class-codetot-admin-options-page.php' (include_path='.:/usr/share/php') in wp-content/plugins/ct-optimization/admin/class-codetot-optimization-admin.php on line 10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
4 plugin tags: settings, codetot, compress, optimization

ct-optimization/codetot-optimization.php 85% from 13 tests

The entry point to "CT Optimization" version 1.0.16 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("ct-optimization.php" instead of "codetot-optimization.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

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 detected1,413 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP122184871,320
PO File1324589
JavaScript22274
CSS1040

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity27.75
▷ Minimum class complexity1.00
▷ Maximum class complexity144.00
Average method complexity4.37
▷ Minimum method complexity1.00
▷ Maximum method complexity50.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods67
▷ Static methods68.96%
▷ Public methods5785.07%
▷ Protected methods913.43%
▷ Private methods11.49%
Functions14
▷ Named functions321.43%
▷ Anonymous functions1178.57%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
5 PNG files occupy 0.80MB with 0.46MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/icon-128x128.png4.50KB1.89KB▼ 57.94%
assets/banner-772x250.png180.69KB72.90KB▼ 59.65%
assets/banner-1544x500.png558.08KB227.93KB▼ 59.16%
assets/icon-256x256.png9.14KB3.84KB▼ 58.02%
assets/screenshot-1.png66.04KB30.46KB▼ 53.89%