78% code-snippet-dm

Code Review | Code Snippet DM

WordPress plugin Code Snippet DM scored78%from 54 tests.

About plugin

  • Plugin page: code-snippet-dm
  • Plugin version: 2.0.3
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.2
  • WordPress version: 6.3.1
  • First release: Aug 30, 2018
  • Latest release: Apr 14, 2023
  • Number of updates: 33
  • Update frequency: every 51.2 days
  • Top authors: necroob (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

700+ active /8,177 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.11MB] [CPU: ▼1.88ms] Passed 4 tests

This is a short check of server-side resources used by Code Snippet DM
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1145.62 ▲2.90
Dashboard /wp-admin3.40 ▲0.1048.53 ▼3.10
Posts /wp-admin/edit.php3.52 ▲0.1652.26 ▲3.86
Add New Post /wp-admin/post-new.php6.01 ▲0.1285.19 ▼6.79
Media Library /wp-admin/upload.php3.33 ▲0.1034.61 ▼0.53

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Code Snippet DM
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,885 ▲9913.93 ▼0.4516.74 ▲14.6441.55 ▼2.28
Dashboard /wp-admin2,202 ▲255.62 ▼0.0685.56 ▼19.3837.26 ▼5.08
Posts /wp-admin/edit.php2,104 ▲71.99 ▲0.0040.01 ▲3.6737.25 ▲4.24
Add New Post /wp-admin/post-new.php6,378 ▲4,85228.16 ▲5.17919.73 ▲240.1438.74 ▼18.07
Media Library /wp-admin/upload.php1,398 ▲14.18 ▼0.0195.37 ▼3.2139.66 ▼4.16

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 50% 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 no errors were found, this is by no means an exhaustive test

SRP 0% 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
Please take a closer look at the following
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/code-snippet-dm/public/partials/code-snippet-dm-public-display.php
    • > /wp-content/plugins/code-snippet-dm/admin/partials/code-snippet-dm-admin-display.php
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'Elementor\\Widget_Base' not found in wp-content/plugins/code-snippet-dm/elementor-widgets/code-snippet.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed:
  • Donate link: Please fix this invalid url: "devmaverick.com/donate"
You can look at the official readme.txt

code-snippet-dm/code-snippet-dm.php Passed 13 tests

The primary PHP file in "Code Snippet DM" version 2.0.3 is used by WordPress to initiate all plugin functionality
134 characters long description:
Display your code snippets in a stylish way inside your content. The plugin uses shortcodes and also very intuitive TinyMCE interface.

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
No dangerous file extensions were detected3,003 lines of code in 64 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript121572891,158
Sass222581501,022
PHP16216640571
JSON200138
CSS4162485
Markdown821029

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.12
Average class complexity2.70
▷ Minimum class complexity1.00
▷ Maximum class complexity6.00
Average method complexity1.44
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods39
▷ Static methods25.13%
▷ Public methods2974.36%
▷ Protected methods37.69%
▷ Private methods717.95%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
admin/img/dm-code-small.png5.43KB1.63KB▼ 69.94%