72% mosmos

Code Review | WP Mosmos Direct

WordPress plugin WP Mosmos Direct scored72%from 54 tests.

About plugin

  • Plugin page: mosmos
  • Plugin version: 2.1.4
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 1.0-6.3
  • WordPress version: 6.3.1
  • First release: Jul 15, 2022
  • Latest release: Oct 24, 2023
  • Number of updates: 81
  • Update frequency: every 5.8 days
  • Top authors: mosmoske (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /828 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▼8.35ms] Passed 4 tests

A check of server-side resources used by WP Mosmos Direct
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0733.58 ▼10.28
Dashboard /wp-admin3.38 ▲0.0443.91 ▼14.69
Posts /wp-admin/edit.php3.50 ▲0.1444.89 ▲0.33
Add New Post /wp-admin/post-new.php5.97 ▲0.0878.87 ▼7.76
Media Library /wp-admin/upload.php3.31 ▲0.0834.20 ▼0.67
Mosmos /wp-admin/options-general.php?page=mosmos3.2530.26

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for WP Mosmos Direct
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲4714.36 ▲0.091.64 ▲0.0537.05 ▼4.81
Dashboard /wp-admin2,196 ▲195.55 ▼0.0585.12 ▼2.9639.87 ▲0.09
Posts /wp-admin/edit.php2,104 ▲41.99 ▲0.0234.69 ▲0.1231.62 ▼2.99
Add New Post /wp-admin/post-new.php1,531 ▲522.97 ▲0.08654.64 ▲14.4069.25 ▲5.81
Media Library /wp-admin/upload.php1,395 ▼24.29 ▲0.0295.60 ▼21.4344.02 ▼3.22
Mosmos /wp-admin/options-general.php?page=mosmos1,0162.0521.4428.43

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=mosmos
    • > Notice in wp-content/plugins/mosmos/smartcheckout.php+266
    Trying to access array offset on value of type bool
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=mosmos
    • > Notice in wp-content/plugins/mosmos/smartcheckout.php+65
    Undefined variable: all_categories

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 1× 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/mosmos/smartcheckout.php:11

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
These are user-side errors you should fix
    • > GET request to /wp-admin/options-general.php?page=mosmos
    • > Javascript (severe) in unknown
    /wp-admin/options-general.php?page=mosmos 253:18 Uncaught SyntaxError: Unexpected token ';'

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
3 plugin tags: settings, configuration, configuration management

mosmos/smartcheckout.php 92% from 13 tests

This is the main PHP file of "WP Mosmos Direct" version 2.1.4, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("mosmos.php" instead of "smartcheckout.php")

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
Everything looks great! No dangerous files found in this plugin597 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP116153597

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.21
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%
Functions22
▷ Named functions22100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
PNG images were not found in this plugin