84% moc-related-product-by-segments

Code Review | MOC - Related Product By Segments

WordPress plugin MOC - Related Product By Segments scored84%from 54 tests.

About plugin

  • Plugin page: moc-related-produ...
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-5.3.2
  • WordPress version: 6.3.1
  • First release: Nov 19, 2018
  • Latest release: Jan 30, 2020
  • Number of updates: 6
  • Update frequency: every 73.5 days
  • Top authors: doiguocmoc (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /3,125 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

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

Server-side resources used by MOC - Related Product By Segments
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0138.61 ▼1.92
Dashboard /wp-admin3.32 ▲0.0146.95 ▼6.49
Posts /wp-admin/edit.php3.37 ▲0.0147.86 ▲1.90
Add New Post /wp-admin/post-new.php5.90 ▲0.0185.00 ▼3.13
Media Library /wp-admin/upload.php3.24 ▲0.0133.80 ▲1.89
MRPBS Options /wp-admin/admin.php?page=mrpbs_settings3.2034.37
About /wp-admin/admin.php?page=mrpbs_about3.2035.66

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for MOC - Related Product By Segments
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,827 ▲9213.62 ▼0.671.67 ▼0.2042.99 ▼6.28
Dashboard /wp-admin2,233 ▲424.85 ▼1.05103.09 ▼8.7038.78 ▼3.95
Posts /wp-admin/edit.php2,113 ▲241.99 ▼0.0235.73 ▼1.8930.63 ▼1.52
Add New Post /wp-admin/post-new.php1,536 ▲2217.62 ▼0.01668.78 ▼7.8758.65 ▲5.00
Media Library /wp-admin/upload.php1,412 ▲244.24 ▲0.0396.87 ▼1.6442.71 ▼2.20
MRPBS Options /wp-admin/admin.php?page=mrpbs_settings9292.0625.8527.11
About /wp-admin/admin.php?page=mrpbs_about8082.0527.0627.34

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

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
Please fix the following items
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/moc-related-product-by-segments/core/admin/add_admin_menu.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/moc-related-product-by-segments/core/admin/add_admin_menu.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/moc-related-product-by-segments/core/inc/segments-product.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
4 plugin tags: segments, woocommerce, related product, product by segments

moc-related-product-by-segments/moc-related-product-by-segments.php 92% from 13 tests

The entry point to "MOC - Related Product By Segments" version 1.0.1 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Domain Path: The domain path is invalid: folder "/language/" does not exist

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
Success! There were no dangerous files found in this plugin197 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP52224197

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG images were found in this plugin