83% smart-codegrape-widget

Code Review | Smart CodeGrape Widget

WordPress plugin Smart CodeGrape Widget scored83%from 54 tests.

About plugin

  • Plugin page: smart-codegrape-w...
  • Plugin version: 1.7.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.9.8
  • WordPress version: 6.3.1
  • First release: Nov 17, 2015
  • Latest release: Oct 13, 2018
  • Number of updates: 20
  • Update frequency: every 53.1 days
  • Top authors: flashblue (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /669 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.08MB] [CPU: ▼2.04ms] Passed 4 tests

A check of server-side resources used by Smart CodeGrape Widget
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0834.82 ▼2.92
Dashboard /wp-admin3.39 ▲0.0845.46 ▼2.88
Posts /wp-admin/edit.php3.44 ▲0.0846.69 ▼2.72
Add New Post /wp-admin/post-new.php5.97 ▲0.0890.13 ▲0.36
Media Library /wp-admin/upload.php3.31 ▲0.0844.36 ▲10.59

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 9 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_sm_codegrape_widget
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Smart CodeGrape Widget
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,802 ▲5613.18 ▼1.114.19 ▲2.6437.30 ▼5.58
Dashboard /wp-admin2,206 ▲155.83 ▼0.0794.25 ▼3.8239.04 ▼5.03
Posts /wp-admin/edit.php2,086 ▼62.01 ▲0.0238.62 ▼0.8234.24 ▼2.55
Add New Post /wp-admin/post-new.php1,538 ▼423.17 ▲5.07584.63 ▼30.3858.37 ▲7.05
Media Library /wp-admin/upload.php1,391 ▼04.20 ▼0.0099.09 ▲0.3840.76 ▼3.04

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
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_sm_codegrape_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function trailingslashit() in wp-content/plugins/smart-codegrape-widget/smartcodegrapewidget.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/smart-codegrape-widget/includes/widget.class.php:6

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

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need your attention:
  • Screenshots: These screenshots require images: #1 (Widget options interface), #2 (Widget in action)
The official readme.txt is a good inspiration

smart-codegrape-widget/smartcodegrapewidget.php 85% from 13 tests

The main PHP file in "Smart CodeGrape Widget" ver. 1.7.0 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("smart-codegrape-widget.php" instead of "smartcodegrapewidget.php")
  • Description: The description should be shorter than 140 characters (currently 316 characters long)

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
There were no executable files found in this plugin392 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP27429285
PO File1303077
CSS14030

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity45.00
▷ Minimum class complexity45.00
▷ Maximum class complexity45.00
Average method complexity5.89
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods00.00%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
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
2 PNG files occupy 0.12MB with 0.07MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png86.23KB26.28KB▼ 69.53%
screenshot-1.png34.40KB17.03KB▼ 50.49%