84% codesnips

Code Review | codeSnips

WordPress plugin codeSnips scored84%from 54 tests.

About plugin

  • Plugin page: codesnips
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-4.9
  • WordPress version: 6.3.1
  • First release: Oct 29, 2015
  • Latest release: Nov 11, 2017
  • Number of updates: 44
  • Update frequency: every 16.9 days
  • Top authors: obrienlabs (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

30+ active /2,621 total downloads


Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.28MB] [CPU: ▼2.79ms] Passed 4 tests

A check of server-side resources used by codeSnips
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.72 ▲0.2652.44 ▲11.69
Dashboard /wp-admin3.58 ▲0.2854.28 ▲1.68
Posts /wp-admin/edit.php3.70 ▲0.3454.14 ▼4.22
Add New Post /wp-admin/post-new.php6.19 ▲0.3089.50 ▼10.66
Media Library /wp-admin/upload.php3.50 ▲0.2838.51 ▲2.03
Settings /wp-admin/edit.php?post_type=snippets&page=cs_settings3.4734.81
Add New /wp-admin/post-new.php?post_type=snippets3.6457.54
All Snippets /wp-admin/edit.php?post_type=snippets3.5538.12

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 15 new files
Database: no new tables, 15 new options
New WordPress options

Browser metrics Passed 4 tests

This is an overview of browser requirements for codeSnips
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,875 ▲11415.38 ▲0.636.46 ▲4.7742.08 ▲0.24
Dashboard /wp-admin2,257 ▲516.02 ▲0.90114.56 ▲10.5540.81 ▼0.07
Posts /wp-admin/edit.php2,150 ▲502.89 ▲0.8343.71 ▲2.1539.55 ▲0.92
Add New Post /wp-admin/post-new.php1,568 ▲3723.65 ▲0.20674.35 ▲13.2052.51 ▼4.78
Media Library /wp-admin/upload.php1,444 ▲445.34 ▲1.19103.04 ▼7.4641.24 ▼7.75
Settings /wp-admin/edit.php?post_type=snippets&page=cs_settings9432.4232.5931.85
Add New /wp-admin/post-new.php?post_type=snippets3,21510.10224.1486.72
All Snippets /wp-admin/edit.php?post_type=snippets1,2072.8438.2331.61

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

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

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)
Everything seems fine, however this is by no means an exhaustive test

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× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/codesnips/template-samples/archive-snippets.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/codesnips/template-samples/single-snippets.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/codesnips/includes/class-codesnips.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side


Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention:
  • Tags: Please reduce the number of tags, currently 16 tag instead of maximum 10
The official readme.txt might help

codesnips/codesnips.php Passed 13 tests

The main PHP script in "codeSnips" version 1.2 is automatically included on every request by WordPress
140 characters long description:
Create individual code snippet posts and then display them as an individual page, show the entire archive list or embed them into your post.

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
Success! There were no dangerous files found in this plugin1,168 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity37.00
▷ Minimum class complexity12.00
▷ Maximum class complexity62.00
Average method complexity2.55
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
▷ Static methods00.00%
▷ Public methods4497.78%
▷ Protected methods00.00%
▷ Private methods12.22%
▷ Named functions00.00%
▷ Anonymous functions1100.00%
▷ 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
1 PNG file occupies 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/OBrienLabs-Logo-h75px.png12.21KB4.67KB▼ 61.79%