83% content-snippet-manager

Code Review | Content Snippet Manager

WordPress plugin Content Snippet Manager scored83%from 54 tests.

About plugin

  • Plugin page: content-snippet-m...
  • Plugin version: 1.1.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-6.3
  • WordPress version: 6.3.1
  • First release: Nov 25, 2020
  • Latest release: Sep 16, 2023
  • Number of updates: 17
  • Update frequency: every 60.3 days
  • Top authors: alexvtn (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active /6,063 total downloads

Benchmarks

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
Install script ran successfully

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

An overview of server-side resources used by Content Snippet Manager
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0342.51 ▲0.93
Dashboard /wp-admin3.34 ▼0.0155.27 ▼9.77
Posts /wp-admin/edit.php3.45 ▲0.0948.98 ▼5.77
Add New Post /wp-admin/post-new.php5.92 ▲0.0391.24 ▼22.29
Media Library /wp-admin/upload.php3.26 ▲0.0341.41 ▲6.24
Content Snippet Manager /wp-admin/admin.php?page=csm_panel3.2334.61

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 78 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Content Snippet Manager
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,827 ▲6614.40 ▲0.021.80 ▼0.3334.85 ▼7.43
Dashboard /wp-admin2,221 ▲445.62 ▼0.0284.03 ▼5.7179.74 ▲35.24
Posts /wp-admin/edit.php2,142 ▲422.11 ▲0.0936.19 ▼3.2437.02 ▼1.56
Add New Post /wp-admin/post-new.php1,569 ▲3723.08 ▼0.18775.82 ▲87.9868.21 ▲14.38
Media Library /wp-admin/upload.php1,432 ▲324.22 ▼0.03111.48 ▲12.1879.78 ▲34.94
Content Snippet Manager /wp-admin/admin.php?page=csm_panel9353.1344.3360.83

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget

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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 5× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/content-snippet-manager/core/shortcodes/fb.php:30
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/content-snippet-manager/core/functions/csm_functions.php:121
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/content-snippet-manager/core/admin/panel.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/content-snippet-manager/core/shortcodes/analytics.php:26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/content-snippet-manager/init.php:49

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

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Screenshots: Add images for these screenshots: #1 (Main settings), #2 (Import/Export section)
  • Tags: Please reduce the number of tags, currently 28 tag instead of maximum 10
The official readme.txt is a good inspiration

content-snippet-manager/init.php 77% from 13 tests

The primary PHP file in "Content Snippet Manager" version 1.1.1 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 156 characters long)
  • Requires at least: The required version number did not match the one declared in readme.txt ("3.5.0" instead of "3.0.0")
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("content-snippet-manager.php" instead of "init.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin34,011 lines of code in 68 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript543,92229031,216
PHP81,6072212,018
CSS511227622
PO File192162155

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity79.75
▷ Minimum class complexity4.00
▷ Maximum class complexity142.00
Average method complexity6.94
▷ Minimum method complexity1.00
▷ Maximum method complexity58.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods53
▷ Static methods00.00%
▷ Public methods5196.23%
▷ Protected methods00.00%
▷ Private methods23.77%
Functions9
▷ Named functions888.89%
▷ Anonymous functions111.11%
Constants3
▷ Global constants3100.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
7 PNG files occupy 0.07MB with 0.05MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
core/assets/images/tip-logo-small.png6.03KB2.90KB▼ 51.90%
core/assets/images/subparent.png0.94KB0.11KB▼ 88.00%
core/assets/images/tip-icon.png1.13KB0.45KB▼ 60.38%
core/assets/images/subparent-hover.png0.93KB0.11KB▼ 88.29%
screenshot-1.png21.75KB9.35KB▼ 57.01%