84% shopmagic-for-contact-form-7

Code Review | ShopMagic for Contact Form 7 and WooCommerce

WordPress plugin ShopMagic for Contact Form 7 and WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: shopmagic-for-con...
  • Plugin version: 1.3.5
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-6.4
  • WordPress version: 6.3.1
  • First release: Sep 1, 2021
  • Latest release: Nov 7, 2023
  • Number of updates: 37
  • Update frequency: every 21.6 days
  • Top authors: wpdesk (100%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active /6,373 total downloads

Benchmarks

Plugin footprint 83% from 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.06MB] [CPU: ▼8.31ms] Passed 4 tests

An overview of server-side resources used by ShopMagic for Contact Form 7 and WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1037.33 ▼3.65
Dashboard /wp-admin3.40 ▲0.0945.33 ▼8.89
Posts /wp-admin/edit.php3.45 ▲0.0947.41 ▼2.98
Add New Post /wp-admin/post-new.php5.92 ▲0.0381.35 ▼17.73
Media Library /wp-admin/upload.php3.26 ▲0.0333.78 ▲1.29

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 159 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-posts
widget_recent-comments
db_upgraded
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
plugin_activation_shopmagic-for-contact-form-7/shopmagic-for-contact-form-7.php
wpdesk_requirements_plugins_data

Browser metrics Passed 4 tests

ShopMagic for Contact Form 7 and WooCommerce: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,796 ▲4914.35 ▼0.001.61 ▼0.0736.42 ▼7.62
Dashboard /wp-admin2,201 ▲275.58 ▼0.0192.46 ▼11.9438.84 ▼5.06
Posts /wp-admin/edit.php2,106 ▲62.10 ▲0.0940.05 ▲1.9337.56 ▼2.40
Add New Post /wp-admin/post-new.php1,532 ▼323.21 ▼1.71691.90 ▲34.6351.62 ▼19.21
Media Library /wp-admin/upload.php1,403 ▲94.15 ▼0.04102.34 ▼6.1945.49 ▼2.03

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_theysaidso_widget
    • plugin_activation_shopmagic-for-contact-form-7/shopmagic-for-contact-form-7.php
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 34× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'ShopMagicCF7Vendor\\WPDesk\\PluginBuilder\\Builder\\AbstractBuilder' not found in wp-content/plugins/shopmagic-for-contact-form-7/vendor_prefixed/wpdesk/wp-builder/src/Builder/InfoActivationBuilder.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Psr\\Log\\AbstractLogger' not found in wp-content/plugins/shopmagic-for-contact-form-7/vendor/psr/log/Psr/Log/Test/TestLogger.php:57
    • > PHP Fatal error
      Uncaught Error: Interface 'ShopMagicCF7Vendor\\WPDesk\\PluginBuilder\\Plugin\\Hookable' not found in wp-content/plugins/shopmagic-for-contact-form-7/vendor_prefixed/wpdesk/wp-wpdesk-tracker/src/PSR/WPDesk/Tracker/OptInPage.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'ShopMagicCF7Vendor\\WPDesk\\Plugin\\Flow\\Initialization\\InitializationFactory' not found in wp-content/plugins/shopmagic-for-contact-form-7/vendor_prefixed/wpdesk/wp-plugin-flow-common/src/Initialization/Simple/SimpleFactory.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'WPDesk\\ShopMagic\\Workflow\\Placeholder\\Placeholder' not found in wp-content/plugins/shopmagic-for-contact-form-7/src/FormBasedPlaceholder.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'ShopMagicCF7Vendor\\WPDesk\\PluginBuilder\\Plugin\\Hookable' not found in wp-content/plugins/shopmagic-for-contact-form-7/vendor_prefixed/wpdesk/wp-wpdesk-tracker/src/PSR/WPDesk/Tracker/Assets.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'WPDesk\\ShopMagicCF7\\FormBasedPlaceholder' not found in wp-content/plugins/shopmagic-for-contact-form-7/src/Placeholder/FormId.php:8
    • > PHP Warning
      require_once(wp-content/plugins/shopmagic-for-contact-form-7/vendor_prefixed/wpdesk/wp-notice/vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/shopmagic-for-contact-form-7/vendor_prefixed/wpdesk/wp-notice/init.php on line 5
    • > PHP Fatal error
      Uncaught Error: Interface 'ShopMagicCF7Vendor\\WPDesk\\PluginBuilder\\Storage\\PluginStorage' not found in wp-content/plugins/shopmagic-for-contact-form-7/vendor_prefixed/wpdesk/wp-builder/src/Storage/StaticStorage.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Psr\\Log\\AbstractLogger' not found in wp-content/plugins/shopmagic-for-contact-form-7/vendor/psr/log/Psr/Log/NullLogger.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
5 plugin tags: contact form 7 woocommerce, form submission, cf7, contact form, marketing automation

shopmagic-for-contact-form-7/shopmagic-for-contact-form-7.php Passed 13 tests

The principal PHP file in "ShopMagic for Contact Form 7 and WooCommerce" v. 1.3.5 is loaded by WordPress automatically on each request
76 characters long description:
Allows creating WooCommerce automations based on Contact Form 7 submissions.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected5,736 lines of code in 150 files:
LanguageFilesBlank linesComment linesLines of code
PHP1345223,1115,098
JSON1000477
CSS219283
JavaScript21053
Markdown25025

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity4.66
▷ Minimum class complexity1.00
▷ Maximum class complexity79.00
Average method complexity2.10
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces21
Interfaces27
Traits7
Classes80
▷ Abstract classes67.50%
▷ Concrete classes7492.50%
▷ Final classes79.46%
Methods425
▷ Static methods348.00%
▷ Public methods37287.53%
▷ Protected methods92.12%
▷ Private methods4410.35%
Functions30
▷ Named functions1446.67%
▷ Anonymous functions1653.33%
Constants49
▷ Global constants00.00%
▷ Class constants49100.00%
▷ Public constants49100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
6 PNG files occupy 0.10MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor_prefixed/wpdesk/wp-wpdesk-tracker/src/assets/images/octolize.com.png88.91KB39.07KB▼ 56.06%
vendor_prefixed/wpdesk/wp-wpdesk-tracker/src/assets/images/logo@2x.png4.17KB4.47KB0.00%
vendor_prefixed/wpdesk/wp-wpdesk-tracker/src/assets/images/wpdesk.pl.png2.36KB2.43KB0.00%
vendor_prefixed/wpdesk/wp-wpdesk-tracker/src/assets/images/wpdesk.net.png2.36KB2.43KB0.00%
vendor_prefixed/wpdesk/wp-wpdesk-tracker/src/assets/images/flexibleshipping.com.png5.63KB3.68KB▼ 34.58%