99% mosh-companion

Code Review | Mosh Companion

WordPress plugin Mosh Companion scored 99% from 54 tests.

About plugin

  • Plugin page: mosh-companion
  • Plugin version: 1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.1
  • WordPress version: 5.8.1
  • First release: Sep 14, 2018
  • Latest release: Feb 15, 2019
  • Number of updates: 6
  • Update frequency: every 25.8 days
  • Top authors: machothemes (66.67%)colorlibplugins (50%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 614 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.00MB] [CPU: ▼137.51ms] Passed 4 tests

This is a short check of server-side resources used by Mosh Companion
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.1235.73 ▲13.06
Dashboard /wp-admin3.06 ▲0.0148.59 ▲5.91
Posts /wp-admin/edit.php3.11 ▲0.0143.27 ▼4.04
Add New Post /wp-admin/post-new.php5.42 ▼0.0190.92 ▼555.25
Media Library /wp-admin/upload.php3.01 ▲0.0132.94 ▲3.36

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 59 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Mosh Companion: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,721 ▲12515.84 ▲0.3113.18 ▲3.3850.53 ▲2.75
Dashboard /wp-admin2,985 ▲545.92 ▼0.17137.44 ▼12.76111.59 ▼4.53
Posts /wp-admin/edit.php2,759 ▲202.72 ▲0.0165.47 ▲0.0399.78 ▲16.10
Add New Post /wp-admin/post-new.php1,883 ▲20719.09 ▲0.22368.01 ▼7.67107.49 ▲5.00
Media Library /wp-admin/upload.php1,822 ▲155.02 ▼0.01153.50 ▲4.32119.20 ▼3.19

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Uninstall script ran successfully

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

SRP Passed 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
Congratulations! This plugin passed the SRP test

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 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention:
  • Tags: Too many tags (11 tag instead of maximum 10); only the first 5 tags are used in your directory listing
  • Plugin Name: Please specify the plugin name on the first line ( === mosh-companion === )
You can look at the official readme.txt

mosh-companion/mosh-companion.php Passed 13 tests

The principal PHP file in "Mosh Companion" v. 1.0 is loaded by WordPress automatically on each request
45 characters long description:
Mosh Companion is a companion for Mosh theme.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin13,421 lines of code in 51 files:
LanguageFilesBlank linesComment linesLines of code
PHP309908937,221
XML140233,952
CSS6391,128
JavaScript12154155757
SVG100362
JSON1001

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity12.92
▷ Minimum class complexity4.00
▷ Maximum class complexity37.00
Average method complexity2.90
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes25
▷ Abstract classes00.00%
▷ Concrete classes25100.00%
▷ Final classes14.00%
Methods157
▷ Static methods42.55%
▷ Public methods11472.61%
▷ Protected methods4025.48%
▷ Private methods31.91%
Functions14
▷ Named functions1392.86%
▷ Anonymous functions17.14%
Constants9
▷ Global constants666.67%
▷ Class constants333.33%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.08MB with 0.05MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
inc/demo-data/screen-image.png79.92KB29.37KB▼ 63.25%