84% snippy

Code Review | Snippy

WordPress plugin Snippy scored84%from 54 tests.

About plugin

  • Plugin page: snippy
  • Plugin version: 1.4.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.3.0
  • WordPress version: 6.3.1
  • First release: Jul 21, 2017
  • Latest release: Jan 14, 2020
  • Number of updates: 46
  • Update frequency: every 19.8 days
  • Top authors: pqina (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

800+ active /5,431 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.06MB] [CPU: ▲24.51ms] Passed 4 tests

An overview of server-side resources used by Snippy
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1767.53 ▲25.15
Dashboard /wp-admin3.35 ▲0.0475.79 ▲20.73
Posts /wp-admin/edit.php3.46 ▲0.1091.28 ▲39.97
Add New Post /wp-admin/post-new.php5.95 ▲0.06128.61 ▲25.67
Media Library /wp-admin/upload.php3.27 ▲0.0465.71 ▲26.50
Bits /wp-admin/admin.php?page=snippy_bits3.2474.02
Shortcodes /wp-admin/admin.php?page=snippy3.2456.87
Add Bit /wp-admin/admin.php?page=snippy_edit_bit3.2458.67
Add Shortcode /wp-admin/admin.php?page=snippy_edit_shortcode3.2458.63

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 25 new files
Database: 3 new tables, 7 new options
New tables
wp_snippy_shortcodes
wp_snippy_shortcode_bits
wp_snippy_bits
New WordPress options
widget_theysaidso_widget
can_compress_scripts
db_upgraded
widget_recent-comments
snippy_db_version
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Snippy
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,899 ▲13814.29 ▲0.001.87 ▲0.0944.36 ▲3.03
Dashboard /wp-admin2,302 ▲1255.60 ▲0.0184.81 ▼9.0839.30 ▼4.66
Posts /wp-admin/edit.php2,219 ▲1162.06 ▲0.0641.81 ▼1.2235.36 ▼3.06
Add New Post /wp-admin/post-new.php1,561 ▲2522.46 ▼0.85693.58 ▼0.4349.69 ▲0.58
Media Library /wp-admin/upload.php1,508 ▲1114.22 ▲0.02101.51 ▼42.6044.44 ▼7.51
Bits /wp-admin/admin.php?page=snippy_bits1,0602.0630.2835.30
Shortcodes /wp-admin/admin.php?page=snippy1,0212.1927.6331.00
Add Bit /wp-admin/admin.php?page=snippy_edit_bit1,2933.2964.3258.07
Add Shortcode /wp-admin/admin.php?page=snippy_edit_shortcode9812.0426.9132.49

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 7× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/snippy/includes/list.php on line 6
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/snippy/includes/list.php on line 6
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/snippy/includes/list.php on line 6
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/file.php): failed to open stream: No such file or directory in wp-content/plugins/snippy/includes/bits.php on line 6
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/file.php' (include_path='.:/usr/share/php') in wp-content/plugins/snippy/includes/bits.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function snippy\\is_admin() in wp-content/plugins/snippy/snippy.php:52
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/snippy/includes/bits.php on line 6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
5 plugin tags: short code, build, javascript, shortcode, create

snippy/snippy.php Passed 13 tests

The main file in "Snippy" v. 1.4.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
49 characters long description:
Snippy, create your own super flexible shortcodes

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin1,558 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP103741331,193
JavaScript76110193
CSS15327159
SVG15513

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity18.12
▷ Minimum class complexity2.00
▷ Maximum class complexity53.00
Average method complexity3.09
▷ Minimum method complexity1.00
▷ Maximum method complexity25.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods60
▷ Static methods4168.33%
▷ Public methods5896.67%
▷ Protected methods00.00%
▷ Private methods23.33%
Functions6
▷ Named functions116.67%
▷ Anonymous functions583.33%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
admin/js/mce/icon.png0.88KB0.17KB▼ 80.27%