72% marketing-optimizer

Code Review | Marketing Optimizer

WordPress plugin Marketing Optimizer scored72%from 54 tests.

About plugin

  • Plugin page: marketing-optimizer
  • Plugin version: 20200925...
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.5.1
  • WordPress version: 6.3.1
  • First release: Aug 19, 2013
  • Latest release: Sep 23, 2020
  • Number of updates: 125
  • Update frequency: every 20.8 days
  • Top authors: activeim (90.4%)marketingoptimizer (10.4%)

Code review

54 tests

User reviews

10 reviews

Install metrics

40+ active /22,109 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲1.32MB] [CPU: ▲6.53ms] Passed 4 tests

An overview of server-side resources used by Marketing Optimizer
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.73 ▲1.2752.74 ▲13.25
Dashboard /wp-admin4.65 ▲1.3055.63 ▼6.91
Posts /wp-admin/edit.php4.70 ▲1.3562.91 ▲16.15
Add New Post /wp-admin/post-new.php7.25 ▲1.36102.20 ▲3.99
Media Library /wp-admin/upload.php4.57 ▲1.3451.23 ▲15.79
Categories /wp-admin/edit-tags.php?taxonomy=mo_sp_category&post_type=mo_sp4.5749.14
Categories /wp-admin/edit-tags.php?taxonomy=mo_ct_category&post_type=mo_ct4.5744.96
Add New /wp-admin/post-new.php?post_type=mo_sp4.6956.08
Pop-Ups /wp-admin/edit.php?post_type=mo_sp4.6449.18
Add New /wp-admin/post-new.php?post_type=mo_landing_page4.7563.00
Maketing Optimizer for Wordpress /wp-admin/options-general.php?page=settings-sub-menu4.6048.26
Add New /wp-admin/post-new.php?post_type=mo_ct4.6959.40
Calls-To-Action /wp-admin/edit.php?post_type=mo_ct4.6446.38
Categories /wp-admin/edit-tags.php?taxonomy=mo_landing_page_category&post_type=mo_landing_page4.5745.59
Landing Pages /wp-admin/edit.php?post_type=mo_landing_page4.6447.63

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 653 new files
Database: no new tables, 9 new options
New WordPress options
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
mo_account_id
can_compress_scripts
widget_mo_cta_widget
marketing-optimizer_settings
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Marketing Optimizer
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,126 ▲38014.72 ▲0.137.07 ▲5.4435.95 ▼3.12
Dashboard /wp-admin2,398 ▲2105.44 ▲0.54100.52 ▼16.4488.25 ▲41.06
Posts /wp-admin/edit.php2,308 ▲2192.77 ▲0.7243.65 ▲3.4551.84 ▲12.37
Add New Post /wp-admin/post-new.php1,862 ▲32022.81 ▲4.48665.48 ▲26.8237.83 ▼17.12
Media Library /wp-admin/upload.php1,590 ▲1994.65 ▲0.4098.29 ▲0.3286.54 ▲41.33
Categories /wp-admin/edit-tags.php?taxonomy=mo_sp_category&post_type=mo_sp1,4782.3931.9351.73
Categories /wp-admin/edit-tags.php?taxonomy=mo_ct_category&post_type=mo_ct1,4762.4231.1759.36
Add New /wp-admin/post-new.php?post_type=mo_sp3,0727.85182.44118.05
Pop-Ups /wp-admin/edit.php?post_type=mo_sp1,3732.7336.8761.16
Add New /wp-admin/post-new.php?post_type=mo_landing_page2,9887.71170.38109.21
Maketing Optimizer for Wordpress /wp-admin/options-general.php?page=settings-sub-menu1,7002.8237.5563.66
Add New /wp-admin/post-new.php?post_type=mo_ct3,0097.77174.92113.46
Calls-To-Action /wp-admin/edit.php?post_type=mo_ct1,3322.7635.4930.90
Categories /wp-admin/edit-tags.php?taxonomy=mo_landing_page_category&post_type=mo_landing_page1,4782.3831.3947.52
Landing Pages /wp-admin/edit.php?post_type=mo_landing_page1,3732.7937.3351.02

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • This plugin does not fully uninstall, leaving 8 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_mo_cta_widget
    • widget_recent-comments
    • mo_account_id

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=mo_ct
    • > Notice in wp-content/plugins/marketing-optimizer/includes/class.mo_metaboxes.php+296
    Undefined variable: theme_template

SRP 0% 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
Almost there! Just fix the following items
  • 29× PHP files output non-empty strings when accessed directly via GET requests (only 10 are shown):
    • > /wp-content/plugins/marketing-optimizer/templates/mo_lp_form_min/mo_lp_form_min.php
    • > /wp-content/plugins/marketing-optimizer/templates/mo_ct_advertisement5/mo_ct_advertisement5.php
    • > /wp-content/plugins/marketing-optimizer/templates/mo_ct_advertisement4/mo_ct_advertisement4.php
    • > /wp-content/plugins/marketing-optimizer/templates/mo_ct_advertisement6/mo_ct_advertisement6.php
    • > /wp-content/plugins/marketing-optimizer/templates/mo_sp_newsletter/mo_sp_newsletter.php
    • > /wp-content/plugins/marketing-optimizer/templates/mo_lp_form3/mo_lp_form3.php
    • > /wp-content/plugins/marketing-optimizer/templates/mo_sp_custom3/mo_sp_custom3.php
    • > /wp-content/plugins/marketing-optimizer/templates/mo_lp_form4/mo_lp_form4.php
    • > /wp-content/plugins/marketing-optimizer/templates/mo_ct_advertisement1/mo_ct_advertisement1.php
    • > /wp-content/plugins/marketing-optimizer/templates/mo_ct_advertisement8/mo_ct_advertisement8.php
  • 70× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'mo_api' not found in wp-content/plugins/marketing-optimizer/includes/api/class.mo_api_campaigns.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'mo_metaboxes' not found in wp-content/plugins/marketing-optimizer/includes/class.mo_ct_metaboxes.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/marketing-optimizer/includes/class.mo.ct.widget.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'mo_api' not found in wp-content/plugins/marketing-optimizer/includes/api/class.mo_api_accounts.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function bloginfo() in wp-content/plugins/marketing-optimizer/templates/mo_sp_custom2/template.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'mo_plugin' not found in wp-content/plugins/marketing-optimizer/admin/mo-templates-settings.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function bloginfo() in wp-content/plugins/marketing-optimizer/templates/mo_ct_newsletter/template.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function bloginfo() in wp-content/plugins/marketing-optimizer/templates/mo_sp_custom6/template.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function bloginfo() in wp-content/plugins/marketing-optimizer/templates/mo_ct_advertisement3/template.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function bloginfo() in wp-content/plugins/marketing-optimizer/templates/mo_lp_form2/template.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Tags: You are using too many tags: 29 tag instead of maximum 10
  • Donate link: Invalid url: ""
The official readme.txt is a good inspiration

marketing-optimizer/marketing-optimizer.php 92% from 13 tests

The main PHP script in "Marketing Optimizer" version 20200925... is automatically included on every request by WordPress
Please take the time to fix the following:
  • Version: The version number should only use digits and periods (ex. "1.0.3" instead of "20200925...")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected24,413 lines of code in 171 files:
LanguageFilesBlank linesComment linesLines of code
CSS3765918610,895
PHP1051,2135939,320
JavaScript271,3177523,609
SVG200589

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity20.07
▷ Minimum class complexity1.00
▷ Maximum class complexity149.00
Average method complexity2.52
▷ Minimum method complexity1.00
▷ Maximum method complexity29.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes40
▷ Abstract classes00.00%
▷ Concrete classes40100.00%
▷ Final classes00.00%
Methods497
▷ Static methods91.81%
▷ Public methods497100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants14
▷ Global constants1071.43%
▷ Class constants428.57%
▷ Public constants4100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
193 PNG files occupy 6.84MB with 3.32MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
templates/mo_lp_form_min/images/wordpress-logo-simplified-rgb.png23.61KB14.30KB▼ 39.44%
templates/mo_lp_form2/images/tick.png2.93KB0.31KB▼ 89.29%
templates/mo_ct_advertisement2/preview.png7.58KB3.73KB▼ 50.85%
templates/mo_sp_blog/images/marketing-optimizer-logo_300x36.png10.26KB3.80KB▼ 63.02%
admin/css/images/fancy_title_right.png0.49KB0.82KB0.00%