68% mastalab-comments

Code Review | Mastalab comments

WordPress plugin Mastalab comments scored 68% from 54 tests.

About plugin

  • Plugin page: mastalab-comments
  • Plugin version: 1.0.10
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-4.9.8
  • WordPress version: 5.8.1
  • First release: Oct 9, 2018
  • Latest release: Oct 25, 2018
  • Number of updates: 12
  • Update frequency: every 1.4 days
  • Top authors: stom79 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 506 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

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

A check of server-side resources used by Mastalab comments
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.82 ▼0.0225.72 ▼12.65
Dashboard /wp-admin3.16 ▲0.1146.51 ▼1.90
Posts /wp-admin/edit.php3.27 ▲0.1740.76 ▼9.10
Add New Post /wp-admin/post-new.php5.52 ▲0.0996.55 ▼562.63
Media Library /wp-admin/upload.php3.10 ▲0.1032.69 ▼0.18
Mastalab Comments /wp-admin/options-general.php?page=mastalab-comments3.2129.42

Server storage [IO: ▲0.12MB] [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: 28 new files
Database: 2 new tables, 1 new option
New tables
wp_mastalab_comments_cache
wp_mastalab_comments_users
New WordPress options
tom79_mastalab_comments_db_version

Browser metrics Passed 4 tests

This is an overview of browser requirements for Mastalab comments
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,857 ▲26116.74 ▲0.7716.04 ▲5.8447.68 ▲1.74
Dashboard /wp-admin3,010 ▲766.78 ▲0.79148.28 ▼1.48104.07 ▼5.89
Posts /wp-admin/edit.php2,779 ▲403.03 ▲0.3167.87 ▼5.4896.06 ▲8.01
Add New Post /wp-admin/post-new.php1,643 ▼4021.71 ▲3.04279.81 ▼106.31114.64 ▼2.71
Media Library /wp-admin/upload.php1,847 ▲405.42 ▲0.39149.41 ▼6.09110.70 ▼8.89
Mastalab Comments /wp-admin/options-general.php?page=mastalab-comments2,4673.22117.6783.19

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • The plugin did not uninstall successfully, leaving 2 tables in the database
    • wp_mastalab_comments_users
    • wp_mastalab_comments_cache
  • Zombie WordPress options were found after uninstall: 1 option
    • tom79_mastalab_comments_db_version

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=mastalab-comments
    • > Notice in wp-content/plugins/mastalab-comments/admin/partials/inc/settings.inc.php+9
    session_start(): A session had already been started - ignoring
    • > GET request to /wp-admin/options-general.php?page=mastalab-comments
    • > Notice in wp-content/plugins/mastalab-comments/admin/partials/inc/settings.inc.php+203
    Undefined index: instance_name
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=mastalab-comments
    • > Notice in wp-content/plugins/mastalab-comments/admin/partials/inc/settings.inc.php+238
    Trying to access array offset on value of type bool

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 7× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/mastalab-comments/public/partials/mastalab_comments-public-display.php
    • > /wp-content/plugins/mastalab-comments/admin/partials/inc/help.inc.php
    • > /wp-content/plugins/mastalab-comments/admin/partials/inc/settings.inc.php
    • > /wp-content/plugins/mastalab-comments/admin/partials/inc/donate.inc.php
    • > /wp-content/plugins/mastalab-comments/Class/Mastodon_api.php
    • > /wp-content/plugins/mastalab-comments/admin/partials/mastalab_comments-admin-display.php
    • > /wp-content/plugins/mastalab-comments/Class/CollectMastodonData.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
3 plugin tags: comments, mastalab, mastodon

mastalab-comments/mastalab_comments.php 92% from 13 tests

"Mastalab comments" version 1.0.10's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("mastalab-comments.php" instead of "mastalab_comments.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected1,474 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP172961,1351,256
JavaScript21154146
CSS215872

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity8.33
▷ Minimum class complexity1.00
▷ Maximum class complexity26.00
Average method complexity1.67
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods99
▷ Static methods44.04%
▷ Public methods8585.86%
▷ Protected methods00.00%
▷ Private methods1414.14%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
public/img/missing.png3.21KB3.62KB0.00%