72% sales-layer-wp-microsites

Code Review | Sales Layer Microsites

WordPress plugin Sales Layer Microsites scored72%from 54 tests.

About plugin

  • Plugin page: sales-layer-wp-mi...
  • Plugin version: 1.7
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.2.2
  • WordPress version: 6.3.1
  • First release: Aug 26, 2019
  • Latest release: Aug 27, 2019
  • Number of updates: 6
  • Update frequency: every 3.3 days
  • Top authors: saleslayer (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /605 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.08MB] [CPU: ▲6.28ms] Passed 4 tests

A check of server-side resources used by Sales Layer Microsites
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1148.13 ▲5.10
Dashboard /wp-admin3.43 ▲0.1258.68 ▲9.95
Posts /wp-admin/edit.php3.46 ▲0.1059.42 ▲9.21
Add New Post /wp-admin/post-new.php5.94 ▲0.0699.48 ▲6.01
Media Library /wp-admin/upload.php3.29 ▲0.0641.62 ▲4.81
How to Start? /wp-admin/admin.php?page=slyrmc_menu3.3040.30
Configuration /wp-admin/admin.php?page=slyrmc_config3.3441.47

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 64 new files
Database: no new tables, 8 new options
New WordPress options
can_compress_scripts
SLYRMC_unique_token
widget_theysaidso_widget
widget_recent-posts
SLYRMC_version
widget_recent-comments
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Sales Layer Microsites
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,851 ▲8014.47 ▼0.081.87 ▼0.3741.26 ▼4.35
Dashboard /wp-admin2,235 ▲475.84 ▲0.96102.82 ▼0.8472.44 ▲32.10
Posts /wp-admin/edit.php2,115 ▲232.00 ▼0.0538.56 ▼3.2837.67 ▲1.06
Add New Post /wp-admin/post-new.php1,544 ▲3022.11 ▲4.55676.23 ▼4.8254.43 ▼5.06
Media Library /wp-admin/upload.php1,414 ▲294.21 ▼0.03102.35 ▼6.8979.61 ▲31.35
How to Start? /wp-admin/admin.php?page=slyrmc_menu8662.0224.6834.66
Configuration /wp-admin/admin.php?page=slyrmc_config8492.0627.2033.82

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
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These server-side errors were triggered
    • > GET request to /wp-admin/admin.php?page=slyrmc_config
    • > Notice in wp-content/plugins/sales-layer-wp-microsites/config.php+18
    Undefined index: slyr
    • > GET request to /wp-admin/admin.php?page=slyrmc_config
    • > Notice in wp-content/plugins/sales-layer-wp-microsites/config.php+18
    Trying to access array offset on value of type null

SRP 0% 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
Please fix the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/sales-layer-wp-microsites/catalog.php
  • 12× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: print_data in wp-content/plugins/sales-layer-wp-microsites/catalog.php on line 53
    • > PHP Notice
      Undefined variable: print_data in wp-content/plugins/sales-layer-wp-microsites/catalog.php on line 65
    • > PHP Notice
      Undefined variable: print_data in wp-content/plugins/sales-layer-wp-microsites/catalog.php on line 114
    • > PHP Notice
      Undefined variable: print_data in wp-content/plugins/sales-layer-wp-microsites/catalog.php on line 87
    • > PHP Notice
      Undefined variable: print_data in wp-content/plugins/sales-layer-wp-microsites/catalog.php on line 109
    • > PHP Notice
      Undefined variable: print_data in wp-content/plugins/sales-layer-wp-microsites/catalog.php on line 101
    • > PHP Notice
      Undefined variable: print_data in wp-content/plugins/sales-layer-wp-microsites/catalog.php on line 42
    • > PHP Notice
      Undefined variable: print_data in wp-content/plugins/sales-layer-wp-microsites/catalog.php on line 58
    • > PHP Notice
      Undefined variable: print_data in wp-content/plugins/sales-layer-wp-microsites/catalog.php on line 79
    • > PHP Notice
      Undefined variable: print_data in wp-content/plugins/sales-layer-wp-microsites/catalog.php on line 71

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
7 plugin tags: pim, product management, automation, catalog management, content management...

sales-layer-wp-microsites/controller.php 92% from 13 tests

The main PHP script in "Sales Layer Microsites" version 1.7 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("sales-layer-wp-microsites.php" instead of "controller.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin13,172 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
CSS64241728,048
PHP121,5309183,870
SVG200699
JavaScript323447516
Markdown18039

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
These items need your attention
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 116)
Cyclomatic complexity
Average complexity per logical line of code0.74
Average class complexity142.83
▷ Minimum class complexity9.00
▷ Maximum class complexity553.00
Average method complexity6.56
▷ Minimum method complexity1.00
▷ Maximum method complexity116.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods153
▷ Static methods00.00%
▷ Public methods12179.08%
▷ Protected methods21.31%
▷ Private methods3019.61%
Functions17
▷ Named functions17100.00%
▷ Anonymous functions00.00%
Constants15
▷ Global constants1173.33%
▷ Class constants426.67%
▷ Public constants4100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
15 PNG files occupy 1.12MB with 0.18MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/switch/mask-square.png0.19KB0.18KB▼ 2.63%
images/logo_head_connector.png1.18KB1.11KB▼ 6.36%
css/close.png0.25KB0.28KB0.00%
images/switch/mask.png0.40KB0.41KB0.00%
images/screenshot-1.png434.26KB131.51KB▼ 69.72%