84% mahjong

Code Review | Mahjong

WordPress plugin Mahjong scored84%from 54 tests.

About plugin

  • Plugin page: mahjong
  • Plugin version: 1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-3.4.2
  • WordPress version: 6.3.1
  • First release: Nov 24, 2012
  • Latest release: Dec 10, 2012
  • Number of updates: 11
  • Update frequency: every 1.6 days
  • Top authors: Hirofumi Ohta (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,078 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.05MB] [CPU: ▼1.25ms] Passed 4 tests

Analyzing server-side resources used by Mahjong
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0541.44 ▲2.48
Dashboard /wp-admin3.36 ▲0.0545.77 ▼2.71
Posts /wp-admin/edit.php3.41 ▲0.0547.72 ▼1.22
Add New Post /wp-admin/post-new.php5.94 ▲0.0593.37 ▼3.53
Media Library /wp-admin/upload.php3.28 ▲0.0537.60 ▲4.73

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 561 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Mahjong
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲8413.23 ▼1.151.74 ▼0.2943.15 ▼8.35
Dashboard /wp-admin2,222 ▲315.87 ▲0.99107.99 ▼2.2742.82 ▼1.09
Posts /wp-admin/edit.php2,108 ▲162.01 ▲0.0348.90 ▲7.0838.99 ▲1.75
Add New Post /wp-admin/post-new.php1,546 ▲1323.28 ▼0.08581.62 ▼91.0851.13 ▼0.36
Media Library /wp-admin/upload.php1,404 ▲164.21 ▼0.0096.80 ▼5.5142.58 ▼0.12

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

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 items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function load_plugin_textdomain() in wp-content/plugins/mahjong/mahjong.php:531

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

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention:
  • Screenshots: Screenshot #1 (screenshot-2.png) image required
You can look at the official readme.txt

mahjong/mahjong.php Passed 13 tests

The primary PHP file in "Mahjong" version 1.4 is used by WordPress to initiate all plugin functionality
18 characters long description:
Mahjong hai plugin

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
There were no executable files found in this plugin363 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP125183339
PO File141024

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity35.00
▷ Minimum class complexity35.00
▷ Maximum class complexity35.00
Average method complexity4.40
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods10
▷ Static methods00.00%
▷ Public methods10100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants16
▷ Global constants00.00%
▷ Class constants16100.00%
▷ Public constants16100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
554 PNG files occupy 0.95MB with 0.36MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/default_large/2s1.png0.68KB0.33KB▼ 51.44%
screenshot-2.png19.36KB8.22KB▼ 57.53%
images/default_small/%s2.png1.31KB1.17KB▼ 10.09%
images/default_middle/1p3.png2.25KB1.18KB▼ 47.39%
images/default_small/1s1.png1.89KB1.47KB▼ 22.06%