84% mahjong-tiles

Code Review | Mahjong Tiles

WordPress plugin Mahjong Tiles scored 84% from 54 tests.

About plugin

  • Plugin page: mahjong-tiles
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-6.1
  • WordPress version: 6.3.1
  • First release: Mar 10, 2015
  • Latest release: Oct 26, 2022
  • Number of updates: 9
  • Update frequency: every 309.7 days
  • Top authors: msaari (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,512 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.02MB] [CPU: ▼4.57ms] Passed 4 tests

This is a short check of server-side resources used by Mahjong Tiles
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0241.26 ▼2.00
Dashboard /wp-admin3.33 ▲0.0345.33 ▼6.01
Posts /wp-admin/edit.php3.38 ▲0.0248.75 ▲0.65
Add New Post /wp-admin/post-new.php5.91 ▲0.0286.86 ▼10.92
Media Library /wp-admin/upload.php3.25 ▲0.0235.95 ▲0.83
Mahjong Tiles /wp-admin/options-general.php?page=mahjong-tiles3.2334.81

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Mahjong Tiles
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.31 ▼1.071.84 ▼0.3542.48 ▼8.33
Dashboard /wp-admin2,210 ▲225.83 ▲0.9593.37 ▼21.7837.99 ▼7.41
Posts /wp-admin/edit.php2,093 ▲42.00 ▼0.0333.94 ▼3.0134.31 ▼0.09
Add New Post /wp-admin/post-new.php1,517 ▲317.75 ▲0.26670.02 ▲30.5457.17 ▲7.92
Media Library /wp-admin/upload.php1,395 ▲74.19 ▲0.0093.41 ▼2.3944.57 ▼0.41
Mahjong Tiles /wp-admin/options-general.php?page=mahjong-tiles8622.0123.9270.39

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded

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)
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 1× 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/mahjong-tiles/mahjongtiles.php:29

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)
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === mahjong-tiles === )
You can take inspiration from this readme.txt

mahjong-tiles/mahjongtiles.php 92% from 13 tests

The main PHP script in "Mahjong Tiles" version 1.0 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("mahjong-tiles.php" instead of "mahjongtiles.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 plugin107 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP13521107

PHP code Passed 2 tests

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

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
42 PNG files occupy 0.10MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
tile_images/c1.png1.93KB1.51KB▼ 21.78%
tile_images/gd.png2.25KB1.65KB▼ 26.56%
tile_images/d8.png2.83KB1.85KB▼ 34.64%
tile_images/d4.png2.29KB1.55KB▼ 32.52%
tile_images/b9.png3.68KB2.08KB▼ 43.30%