78% styler-for-contact-form-7

Code Review | Styler for Contact Form 7

WordPress plugin Styler for Contact Form 7 scored78%from 54 tests.

About plugin

  • Plugin page: styler-for-contac...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.7.3
  • WordPress version: 6.3.1
  • First release: Jun 11, 2016
  • Latest release: Apr 6, 2017
  • Number of updates: 3
  • Update frequency: every 100.0 days
  • Top authors: wpmonks (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

70+ active /3,369 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼7.59ms] Passed 4 tests

A check of server-side resources used by Styler for Contact Form 7
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0236.25 ▼2.46
Dashboard /wp-admin3.33 ▼0.0247.71 ▼13.99
Posts /wp-admin/edit.php3.38 ▲0.0253.79 ▲4.77
Add New Post /wp-admin/post-new.php5.91 ▲0.0289.93 ▼18.05
Media Library /wp-admin/upload.php3.25 ▲0.0239.70 ▲4.13
Documentation /wp-admin/admin.php?page=cf-styler-documentation3.2237.46
Licenses /wp-admin/admin.php?page=cf_styler_licenses3.2234.60
Add-Ons /wp-admin/admin.php?page=cf-styler-addons3.2232.56

Server storage [IO: ▲1.05MB] [DB: ▲0.07MB] Passed 3 tests

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 47 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
can_compress_scripts
db_upgraded
cf_styler_licenses

Browser metrics Passed 4 tests

An overview of browser requirements for Styler for Contact Form 7
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,822 ▲7614.30 ▲0.121.80 ▼0.0141.23 ▼1.30
Dashboard /wp-admin2,225 ▲445.58 ▼0.1187.72 ▼20.5939.51 ▼0.59
Posts /wp-admin/edit.php2,133 ▲332.01 ▲0.0241.26 ▲0.3436.37 ▲0.05
Add New Post /wp-admin/post-new.php1,567 ▲2223.50 ▲0.34657.82 ▼20.0961.90 ▲7.20
Media Library /wp-admin/upload.php1,433 ▲304.23 ▲0.01106.63 ▲11.3044.05 ▼1.37
Documentation /wp-admin/admin.php?page=cf-styler-documentation8912.0630.1057.55
Licenses /wp-admin/admin.php?page=cf_styler_licenses8162.0327.3125.39
Add-Ons /wp-admin/admin.php?page=cf-styler-addons8272.0126.6727.19

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie WordPress options detected upon uninstall: 7 options
    • cf_styler_licenses
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 50% 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)
Even though everything seems fine, this is not 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
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/styler-for-contact-form-7/styler-for-contact-form7.php
  • 45× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Undefined variable: wp_customize in wp-content/plugins/styler-for-contact-form-7/includes/checkbox-inputs.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to a member function add_section() on null in wp-content/plugins/styler-for-contact-form-7/includes/form-title.php:3
    • > PHP Fatal error
      Uncaught Error: Call to a member function add_section() on null in wp-content/plugins/styler-for-contact-form-7/includes/dropdown-fields.php:4
    • > PHP Notice
      Undefined variable: wp_customize in wp-content/plugins/styler-for-contact-form-7/includes/field-sub-labels.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to a member function add_section() on null in wp-content/plugins/styler-for-contact-form-7/includes/checkbox-inputs.php:3
    • > PHP Fatal error
      Uncaught Error: Call to a member function add_setting() on null in wp-content/plugins/styler-for-contact-form-7/includes/section-break-description.php:4
    • > PHP Notice
      Undefined variable: wp_customize in wp-content/plugins/styler-for-contact-form-7/includes/form-wrapper.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to a member function add_section() on null in wp-content/plugins/styler-for-contact-form-7/includes/field-sub-labels.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/styler-for-contact-form-7/display/class-styles.php:2
    • > PHP Notice
      Undefined variable: wp_customize in wp-content/plugins/styler-for-contact-form-7/includes/section-break-title.php on line 3

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 94% from 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
Please fix the following attributes:
  • Screenshots: Please add images for these screenshots: #1 (Open Customize window), #2 (Styler for Contact Form 7 Panel), #3 (Sections for Settings), #4 (Options in settings)
You can look at the official readme.txt

styler-for-contact-form-7/styler-for-contact-form7.php 92% from 13 tests

This is the main PHP file of "Styler for Contact Form 7" version 1.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("styler-for-contact-form-7.php" instead of "styler-for-contact-form7.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin2,941 lines of code in 30 files:
LanguageFilesBlank linesComment linesLines of code
PHP275485002,289
JavaScript2221510626
CSS14026

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity15.75
▷ Minimum class complexity1.00
▷ Maximum class complexity75.00
Average method complexity4.81
▷ Minimum method complexity1.00
▷ Maximum method complexity69.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods31
▷ Static methods00.00%
▷ Public methods3096.77%
▷ Protected methods00.00%
▷ Private methods13.23%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
11 PNG files occupy 0.57MB with 0.33MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/images/active.png1.63KB1.34KB▼ 17.74%
admin-menu/images/step3.png41.28KB13.47KB▼ 67.36%
assets/screenshot-4.png72.80KB23.31KB▼ 67.98%
assets/screenshot-3.png68.93KB22.11KB▼ 67.93%
assets/screenshot-1.png58.90KB18.01KB▼ 69.42%