68% mystyle-custom-product-designer

Code Review | MyStyle Custom Product Designer

WordPress plugin MyStyle Custom Product Designer scored68%from 54 tests.

About plugin

  • Plugin page: mystyle-custom-pr...
  • Plugin version: 3.19.31
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 2.2.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Jun 13, 2015
  • Latest release: Dec 1, 2023
  • Number of updates: 391
  • Update frequency: every 7.9 days
  • Top authors: mystyleplatform (100%)

Code review

54 tests

User reviews

13 reviews

Install metrics

50+ active /48,710 total downloads

Benchmarks

Plugin footprint 65% 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.58MB] [CPU: ▲11.82ms] Passed 4 tests

Analyzing server-side resources used by MyStyle Custom Product Designer
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.95 ▲1.4847.82 ▲6.05
Dashboard /wp-admin4.95 ▲1.60586.80 ▲525.86
Posts /wp-admin/edit.php4.99 ▲1.6362.54 ▲9.40
Add New Post /wp-admin/post-new.php7.59 ▲1.70104.87 ▲14.73
Media Library /wp-admin/upload.php4.85 ▲1.6256.60 ▲17.08
Design Collections /wp-admin/edit-tags.php?taxonomy=design_collection4.8547.09
Dashboard /wp-admin/admin.php?page=mystyle4.7448.25
Design Tags /wp-admin/edit-tags.php?taxonomy=design_tag4.8549.58
Add-ons /wp-admin/admin.php?page=mystyle_addons4.7747.70
Settings /wp-admin/admin.php?page=mystyle_settings4.7746.94

Server storage [IO: ▲1.48MB] [DB: ▲0.01MB] Passed 3 tests

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 183 new files
Database: 2 new tables, 12 new options
New tables
wp_mystyle_designs
wp_mystyle_sessions
New WordPress options
mystyle_notices
mystyle_license_status_
widget_theysaidso_widget
widget_recent-posts
mystyle_options
mystyle_last_license_update
db_upgraded
theysaidso_admin_options
mystyle_last_update_datetime
widget_recent-comments
...

Browser metrics Passed 4 tests

An overview of browser requirements for MyStyle Custom Product Designer
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,586 ▼17614.36 ▲0.011.41 ▼0.2012.89 ▼30.85
Dashboard /wp-admin2,285 ▲1085.89 ▲0.2494.48 ▼2.7089.52 ▲46.66
Posts /wp-admin/edit.php2,334 ▲2342.42 ▲0.4341.41 ▼1.0339.90 ▲3.04
Add New Post /wp-admin/post-new.php1,782 ▲24722.50 ▼2.58758.77 ▲166.1045.49 ▼19.20
Media Library /wp-admin/upload.php1,501 ▲1044.59 ▲0.36109.21 ▲9.1788.21 ▲46.00
Design Collections /wp-admin/edit-tags.php?taxonomy=design_collection1,3422.1335.5836.16
Dashboard /wp-admin/admin.php?page=mystyle9391.126.7219.97
Design Tags /wp-admin/edit-tags.php?taxonomy=design_tag1,3422.1433.7434.43
Add-ons /wp-admin/admin.php?page=mystyle_addons1,1552.0230.0652.49
Settings /wp-admin/admin.php?page=mystyle_settings1,4302.0231.6935.54

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • Zombie tables were found after uninstall: 2 tables
    • wp_mystyle_designs
    • wp_mystyle_sessions
  • Zombie WordPress options were found after uninstall: 11 options
    • mystyle_options
    • can_compress_scripts
    • mystyle_license_status_
    • mystyle_last_license_update
    • db_upgraded
    • recovery_mode_email_last_sent
    • widget_recent-comments
    • theysaidso_admin_options
    • mystyle_last_update_datetime
    • widget_recent-posts
    • ...

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These errors were triggered by the plugin
    • > GET request to /wp-admin/admin.php?page=mystyle
    • > Error in wp-content/plugins/mystyle-custom-product-designer/includes/admin/pages/class-mystyle-dashboard-page.php+246
    Uncaught Error: Call to undefined function wc_get_products() in wp-content/plugins/mystyle-custom-product-designer/includes/admin/pages/class-mystyle-dashboard-page.php:246
    Stack trace:
    #0 wp-content/plugins/mystyle-custom-product-designer/includes/admin/pages/class-mystyle-dashboard-page.php(91): MyStyle_Dashboard_Page->get_total_customizable_products_count()
    #1 wp-includes/class-wp-hook.php(310): MyStyle_Dashboard_Page->render_page()
    #2 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(517): WP_Hook->do_action()
    #4 wp-admin/admin.php(259): do_action()
    #5 {main}
    thrown

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 130× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Warning
      Use of undefined constant MYSTYLE_INCLUDES - assumed 'MYSTYLE_INCLUDES' (this will throw an Error in a future version of PHP) in wp-content/plugins/mystyle-custom-product-designer/tests/includes/admin/notices/test-mystyle-notice-controller.php on line 13
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/mystyle-custom-product-designer/tests/test-mystyle.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/mystyle-custom-product-designer/includes/wprestapi/class-mystyle-wp-rest-api-design-controller.php:13
    • > PHP Warning
      require_once(MYSTYLE_INCLUDESadmin/notices/class-mystyle-notice-controller.php): failed to open stream: No such file or directory in wp-content/plugins/mystyle-custom-product-designer/tests/includes/admin/notices/test-mystyle-notice-controller.php on line 13
    • > PHP Fatal error
      require_once(): Failed opening required 'MYSTYLE_INCLUDESadmin/notices/class-mystyle-notice-controller.php' (include_path='.:/usr/share/php') in wp-content/plugins/mystyle-custom-product-designer/tests/includes/admin/notices/test-mystyle-notice-controller.php on line 13
    • > PHP Fatal error
      Uncaught Error: Class 'MyStyle_Exception' not found in wp-content/plugins/mystyle-custom-product-designer/includes/exceptions/class-mystyle-unauthorized-exception.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Ajax_UnitTestCase' not found in wp-content/plugins/mystyle-custom-product-designer/tests/includes/test-mystyle-ajax.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'MyStyle_EntityManager' not found in wp-content/plugins/mystyle-custom-product-designer/includes/entities/class-mystyle-designmanager.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'MyStyle_AbstractWC' not found in wp-content/plugins/mystyle-custom-product-designer/tests/mocks/mock-mystyle-wc.php:12
    • > PHP Warning
      require_once(MYSTYLE_PATHtests/mocks/mock-mystyle-wc.php): failed to open stream: No such file or directory in wp-content/plugins/mystyle-custom-product-designer/tests/includes/shortcodes/test-mystyle-customizer-shortcode.php on line 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 on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Tags: There are too many tags (15 tag instead of maximum 10)
The official readme.txt might help

mystyle-custom-product-designer/mystyle.php 85% from 13 tests

"MyStyle Custom Product Designer" version 3.19.31's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("mystyle-custom-product-designer.php" instead of "mystyle.php")
  • Requires at least: Required version does not match the one declared in readme.txt ("3.3" instead of "2.2.0")

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 detected23,679 lines of code in 169 files:
LanguageFilesBlank linesComment linesLines of code
PHP1354,5769,98814,299
JSON3007,761
CSS717245814
JavaScript12165157467
Markdown8640136
Bourne Shell121799
XML25491
YAML14012

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity9.81
▷ Minimum class complexity1.00
▷ Maximum class complexity100.00
Average method complexity2.04
▷ Minimum method complexity1.00
▷ Maximum method complexity28.00
Code structure
Namespaces0
Interfaces3
Traits0
Classes116
▷ Abstract classes1311.21%
▷ Concrete classes10388.79%
▷ Final classes10.97%
Methods1,017
▷ Static methods18818.49%
▷ Public methods98196.46%
▷ Protected methods50.49%
▷ Private methods313.05%
Functions21
▷ Named functions21100.00%
▷ Anonymous functions00.00%
Constants43
▷ Global constants2660.47%
▷ Class constants1739.53%
▷ Public constants17100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/mystyle-icon.png1.44KB0.53KB▼ 63.11%
assets/images/mystyle-logo-v2-32x32.png2.84KB1.56KB▼ 45.24%
assets/images/mystyle-logo-v2-100x100.png10.82KB4.26KB▼ 60.58%