94% images-optimize-and-upload-cf7

Code Review | Images Optimize and Upload CF7

WordPress plugin Images Optimize and Upload CF7 scored 94% from 54 tests.

About plugin

  • Plugin page: images-optimize-a...
  • Plugin version: 2.1.3
  • PHP compatiblity: 5.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2.2-5.8.2
  • WordPress version: 5.9.2
  • First release: Aug 17, 2019
  • Latest release: Dec 1, 2021
  • Number of updates: 27
  • Update frequency: every 31.1 days
  • Top authors: yesworld (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

800+ active / 4,119 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼302.59ms] Passed 4 tests

An overview of server-side resources used by Images Optimize and Upload CF7
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.66 ▲0.1555.18 ▼0.75
Dashboard /wp-admin3.49 ▲0.0833.14 ▼1.98
Posts /wp-admin/edit.php3.71 ▲0.0737.35 ▼0.92
Add New Post /wp-admin/post-new.php6.98 ▼0.0297.88 ▼1,206.57
Media Library /wp-admin/upload.php3.36 ▲0.0724.64 ▼0.88
Optimize & Upload /wp-admin/admin.php?page=optimizer-30003.4027.78

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 16 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Images Optimize and Upload CF7
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,803 ▲4815.78 ▼0.206.23 ▲0.122.37 ▼0.46
Dashboard /wp-admin2,925 ▲646.08 ▼0.12125.11 ▼16.41163.54 ▼5.07
Posts /wp-admin/edit.php2,731 ▲373.25 ▲0.0167.91 ▲0.35141.32 ▼5.69
Add New Post /wp-admin/post-new.php1,797 ▲12321.19 ▼0.32443.86 ▲19.27155.83 ▼4.87
Media Library /wp-admin/upload.php1,738 ▲435.49 ▲0.01140.67 ▼6.69186.23 ▼5.14
Optimize & Upload /wp-admin/admin.php?page=optimizer-30001,4872.5057.38151.89

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

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
  • 5× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Notice
      Undefined variable: legend in wp-content/plugins/images-optimize-and-upload-cf7/views/form.tag.cf7.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/images-optimize-and-upload-cf7/views/form.notice.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/images-optimize-and-upload-cf7/views/form.tag.cf7.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/images-optimize-and-upload-cf7/views/form.settings.optimizer.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/images-optimize-and-upload-cf7/index.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
9 plugin tags: compression, ajax uploader, contact form 7 uploader, upload, contact form 7...

images-optimize-and-upload-cf7/index.php 85% from 13 tests

The primary PHP file in "Images Optimize and Upload CF7" version 2.1.3 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("images-optimize-and-upload-cf7.php" instead of "index.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 157 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin1,435 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP8122143668
JavaScript36179346
CSS100221
PO File15758200

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity12.40
▷ Minimum class complexity1.00
▷ Maximum class complexity34.00
Average method complexity2.78
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods32
▷ Static methods26.25%
▷ Public methods2990.62%
▷ Protected methods26.25%
▷ Private methods13.12%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants16
▷ Global constants1062.50%
▷ Class constants637.50%
▷ Public constants466.67%

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