93% ct-optimization

Code Review | CodeTot Optimization

WordPress plugin CodeTot Optimization scored 93% from 54 tests.

About plugin

  • Plugin page: ct-optimization
  • Plugin version: 1.0.12
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.8
  • WordPress version: 5.8.1
  • First release: Dec 26, 2020
  • Latest release: Aug 9, 2021
  • Number of updates: 14
  • Update frequency: every 16.2 days
  • Top authors: codetot (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active / 417 total downloads

Benchmarks

Plugin footprint Passed 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.32MB] [CPU: ▼140.85ms] Passed 4 tests

Analyzing server-side resources used by CodeTot Optimization
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.10 ▲0.3834.67 ▲16.96
Dashboard /wp-admin3.41 ▲0.3657.45 ▲10.52
Posts /wp-admin/edit.php3.46 ▲0.3652.34 ▲2.23
Add New Post /wp-admin/post-new.php5.71 ▲0.2895.23 ▼582.56
Media Library /wp-admin/upload.php3.29 ▲0.2940.40 ▲6.41

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: 30 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

CodeTot Optimization: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,699 ▲9415.76 ▲0.249.30 ▲0.7153.00 ▲1.87
Dashboard /wp-admin2,993 ▲626.04 ▲0.08140.57 ▼13.18116.59 ▼5.41
Posts /wp-admin/edit.php2,759 ▲202.70 ▼0.0072.80 ▲3.0392.80 ▼5.07
Add New Post /wp-admin/post-new.php1,516 ▼16718.86 ▲0.15394.99 ▲7.87113.94 ▼0.40
Media Library /wp-admin/upload.php1,827 ▲174.99 ▼0.02155.56 ▲3.97120.50 ▼0.69

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
This plugin's uninstaller ran successfully

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 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
    • > 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/admin/partials/display.php:14
    • > 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/includes/class-codetot-optimization-assets.php:40

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
3 plugin tags: settings, compress, optimization

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

The entry point to "CodeTot Optimization" version 1.0.12 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,514 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP132435321,421
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 complexity26.78
▷ Minimum class complexity1.00
▷ Maximum class complexity144.00
Average method complexity4.28
▷ Minimum method complexity1.00
▷ Maximum method complexity50.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods74
▷ Static methods79.46%
▷ Public methods6182.43%
▷ Protected methods1216.22%
▷ Private methods11.35%
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-256x256.png9.14KB3.84KB▼ 58.02%
assets/banner-1544x500.png558.08KB227.93KB▼ 59.16%
assets/screenshot-1.png66.04KB30.46KB▼ 53.89%
assets/icon-128x128.png4.50KB1.89KB▼ 57.94%
assets/banner-772x250.png180.69KB72.90KB▼ 59.65%