84% my-snippets

Code Review | My Snippets

WordPress plugin My Snippets scored 84% from 54 tests.

About plugin

  • Plugin page: my-snippets
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.0
  • WordPress version: 6.3.1
  • First release: Dec 3, 2009
  • Latest release: Feb 21, 2019
  • Number of updates: 6
  • Update frequency: every 561.2 days
  • Top authors: greenshady (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

90+ active / 7,980 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

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

A check of server-side resources used by My Snippets
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0334.57 ▼5.25
Dashboard /wp-admin3.32 ▲0.0247.14 ▼1.36
Posts /wp-admin/edit.php3.37 ▲0.0242.64 ▼9.46
Add New Post /wp-admin/post-new.php5.90 ▲0.0287.48 ▼7.60
Media Library /wp-admin/upload.php3.24 ▲0.0236.68 ▲2.87

Server storage [IO: ▲0.04MB] [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: 10 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
widget_snippet

Browser metrics Passed 4 tests

This is an overview of browser requirements for My Snippets
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.16 ▼1.121.66 ▼0.1038.30 ▼2.19
Dashboard /wp-admin2,209 ▲214.88 ▼0.03112.98 ▲10.3042.90 ▼4.00
Posts /wp-admin/edit.php2,089 ▼02.01 ▲0.0235.83 ▼1.9630.19 ▼3.07
Add New Post /wp-admin/post-new.php6,471 ▲4,93420.24 ▼2.91862.36 ▲193.2359.93 ▲8.45
Media Library /wp-admin/upload.php1,391 ▲34.20 ▼0.03100.55 ▼1.3343.37 ▲2.21

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • widget_snippet

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

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
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function MySnippets\\add_action() in wp-content/plugins/my-snippets/src/bootstrap-plugin.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function MySnippets\\add_action() in wp-content/plugins/my-snippets/src/bootstrap-plugin.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/my-snippets/src/Widgets/Snippet.php:22

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

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Screenshots: These screenshots require images: #1 (My Snippets meta box on the edit post screen.), #2 (My Snippets widget on the widgets screen.)
The official readme.txt might help

my-snippets/my-snippets.php Passed 13 tests

The main file in "My Snippets" v. 1.0.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
72 characters long description:
Add custom widget content on a per-post basis from the edit post screen.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin163 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP458142141
Markdown116022

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity10.00
▷ Minimum class complexity5.00
▷ Maximum class complexity15.00
Average method complexity3.25
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions00.00%
▷ Anonymous functions3100.00%
Constants0
▷ Global constants00.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
2 compressed PNG files occupy 0.01MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png2.89KB2.83KB▼ 1.86%
screenshot-2.png5.16KB5.09KB▼ 1.36%