84% mh-osoitekortti

Code Review | Mh Osoitekortti

WordPress plugin Mh Osoitekortti scored84%from 54 tests.

About plugin

  • Plugin page: mh-osoitekortti
  • Plugin version: 1.1.3
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2.0-6.0
  • WordPress version: 6.3.1
  • First release: Mar 2, 2020
  • Latest release: Jun 9, 2022
  • Number of updates: 10
  • Update frequency: every 83.2 days
  • Top authors: verkkovaraani (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /839 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

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

An overview of server-side resources used by Mh Osoitekortti
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0141.03 ▼3.27
Dashboard /wp-admin3.31 ▲0.0152.15 ▼7.04
Posts /wp-admin/edit.php3.37 ▲0.0151.04 ▲5.36
Add New Post /wp-admin/post-new.php5.90 ▲0.0197.97 ▲2.71
Media Library /wp-admin/upload.php3.24 ▲0.0138.93 ▼0.39

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Mh Osoitekortti
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.20 ▼1.435.88 ▲4.0444.64 ▼7.24
Dashboard /wp-admin2,206 ▲215.79 ▼0.06112.59 ▼12.3341.97 ▼4.45
Posts /wp-admin/edit.php2,092 ▲32.02 ▼0.0642.56 ▲2.1237.04 ▼5.62
Add New Post /wp-admin/post-new.php1,535 ▲223.11 ▼0.07707.21 ▼4.0751.62 ▼16.06
Media Library /wp-admin/upload.php1,388 ▼04.13 ▼0.07120.00 ▲10.1452.61 ▼3.83

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
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 75% from 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)
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 9× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mh-osoitekortti/inc/mhcard-add-edit-button.php:5
    • > PHP Warning
      include_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/mh-osoitekortti/mh-osoitekortti.php on line 17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/mh-osoitekortti/inc/mhcard-options.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/mh-osoitekortti/inc/mhcard-add-list-button.php:19
    • > PHP Warning
      include_once(): Failed opening 'ABSPATHwp-admin/includes/plugin.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/mh-osoitekortti/mh-osoitekortti.php on line 17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_plugin_active() in wp-content/plugins/mh-osoitekortti/mh-osoitekortti.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mh-osoitekortti/inc/mhcard-form-handle.php:3
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/mh-osoitekortti/mh-osoitekortti.php on line 17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/mh-osoitekortti/inc/mhcard-input-form.php:3

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, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
3 plugin tags: woocommerce, osoitekortti, matkahuolto

mh-osoitekortti/mh-osoitekortti.php 92% from 13 tests

The primary PHP file in "Mh Osoitekortti" version 1.1.3 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 190 characters long)

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
Everything looks great! No dangerous files found in this plugin852 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP817384704
PO File182104148

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity50.00
▷ Minimum class complexity50.00
▷ Maximum class complexity50.00
Average method complexity1.79
▷ Minimum method complexity1.00
▷ Maximum method complexity45.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods62
▷ Static methods00.00%
▷ Public methods62100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions16
▷ Named functions16100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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