10% mysmark

Code Review | MySmark Plugin

WordPress plugin MySmark Plugin scored10%from 54 tests.

About plugin

  • Plugin page: mysmark
  • Plugin version: 1.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.1
  • WordPress version: 6.3.1
  • First release: Apr 6, 2012
  • Latest release: Jan 30, 2015
  • Number of updates: 57
  • Update frequency: every 18.1 days
  • Top authors: m1rcu2 (52.63%)b-smark (28.07%)Giacomo Persichini (22.81%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,070 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
These installer errors require your attention
  • Install procedure validation failed for this plugin
    • > User notice in wp-includes/functions.php+5905
    Function register_uninstall_hook was called incorrectly. Only a static class method or function can be used in an uninstall hook. Please see Debugging in WordPress for more information. (This message was added in version 3.1.0.)

Server metrics [RAM: ▼1.76MB] [CPU: ▼55.09ms] Passed 4 tests

A check of server-side resources used by MySmark Plugin
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.23 ▼1.239.50 ▼29.66
Dashboard /wp-admin2.25 ▼1.067.37 ▼42.26
Posts /wp-admin/edit.php2.25 ▼1.117.28 ▼47.64
Add New Post /wp-admin/post-new.php2.25 ▼3.648.74 ▼100.78
Media Library /wp-admin/upload.php2.25 ▼0.986.94 ▼29.34
Unlink Posts /wp-admin/admin.php?page=mysmark/MySm_LinkPage.php2.256.44
Control Panel /wp-admin/admin.php?page=mysmark/MySm_AdminPage.php2.257.92

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 20 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
can_compress_scripts
db_upgraded
mysm-width

Browser metrics Passed 4 tests

This is an overview of browser requirements for MySmark Plugin
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,856 ▲11013.33 ▼1.041.93 ▲0.2342.16 ▲0.79
Dashboard /wp-admin2,256 ▲505.79 ▼0.11110.77 ▲9.4843.97 ▼3.26
Posts /wp-admin/edit.php2,138 ▲382.02 ▲0.0139.74 ▲0.3337.59 ▲2.21
Add New Post /wp-admin/post-new.php6,279 ▲4,73918.75 ▲0.39829.96 ▲192.8351.18 ▼0.82
Media Library /wp-admin/upload.php1,435 ▲354.23 ▲0.02100.94 ▲4.1245.82 ▲0.87
Unlink Posts /wp-admin/admin.php?page=mysmark/MySm_LinkPage.php8152.0428.1427.46
Control Panel /wp-admin/admin.php?page=mysmark/MySm_AdminPage.php9981.9827.6228.81

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
You still need to fix the following
  • Uninstall procedure validation failed for this plugin
    • > User notice in wp-includes/functions.php+5905
    Function register_uninstall_hook was called incorrectly. Only a static class method or function can be used in an uninstall hook. Please see Debugging in WordPress for more information. (This message was added in version 3.1.0.)
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • mysm-width
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options

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
These server-side errors were triggered
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mysmark/MySm_AdminPage.php
    • > User notice in wp-includes/functions.php+5905
    Function register_uninstall_hook was called incorrectly. Only a static class method or function can be used in an uninstall hook. Please see Debugging in WordPress for more information. (This message was added in version 3.1.0.)

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/mysmark/MySm_AdminPage.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/mysmark/MySm_LinkPage.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_uninstall_hook() in wp-content/plugins/mysmark/MySm_Plugin.php:36

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (The plugin: E-rose and comment list.), #2 (Settings in the admin page.), #3 (The Meta Box in the New/Edit Post.)
The official readme.txt is a good inspiration

mysmark/MySm_Plugin.php 92% from 13 tests

The main PHP script in "MySmark Plugin" version 1.1.0 is automatically included on every request by WordPress
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("mysmark.php" instead of "MySm_Plugin.php")

Code Analysis 5% from 3 tests

File types 0% from 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
It is important to fix the following items
  • You should never include executable (binary) or otherwise dangerous files in your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/mysmark/SDK/fb_ca_chain_bundle.crt
829 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP6129399733
CSS115573
JavaScript22723

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity31.75
▷ Minimum class complexity4.00
▷ Maximum class complexity84.00
Average method complexity4.15
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes125.00%
▷ Concrete classes375.00%
▷ Final classes00.00%
Methods39
▷ Static methods00.00%
▷ Public methods2871.79%
▷ Protected methods820.51%
▷ Private methods37.69%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 PNG files occupy 0.26MB with 0.15MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png21.81KB10.98KB▼ 49.65%
screenshot-2.png171.24KB64.30KB▼ 62.45%
screenshot-1.png77.71KB33.98KB▼ 56.27%