10% code-school-badges

Code Review | Code School Badges

WordPress plugin Code School Badges scored 10% from 54 tests.

About plugin

  • Plugin page: code-school-badges
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.0
  • WordPress version: 6.3.1
  • First release: Sep 12, 2014
  • Latest release: Sep 23, 2014
  • Number of updates: 15
  • Update frequency: every 0.7 days
  • Top authors: mcnitt (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,277 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
These installer errors require your attention
  • The plugin cannot be installed
    • > Deprecated in wp-content/plugins/code-school-badges/wpcodeschool-badges.php+85
    Methods with the same name as their class will not be constructors in a future version of PHP; Wpcodeschool_Badges_Widget has a deprecated constructor

Server metrics [RAM: ▲0.01MB] [CPU: ▼4.56ms] Passed 4 tests

Analyzing server-side resources used by Code School Badges
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0236.23 ▼1.74
Dashboard /wp-admin3.32 ▲0.0244.22 ▼6.21
Posts /wp-admin/edit.php3.37 ▲0.0146.30 ▲2.30
Add New Post /wp-admin/post-new.php5.90 ▲0.0182.97 ▼9.76
Media Library /wp-admin/upload.php3.24 ▲0.0133.12 ▼0.52
Code School Badges /wp-admin/options-general.php?page=wpcodeschool-badges3.2829.32

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 15 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
widget_wpcodeschool_badges_widget
can_compress_scripts

Browser metrics Passed 4 tests

Code School Badges: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,918 ▲18313.66 ▼0.998.11 ▲6.0443.46 ▼3.41
Dashboard /wp-admin2,212 ▲245.91 ▲1.04100.45 ▼20.3739.05 ▼13.29
Posts /wp-admin/edit.php2,095 ▲62.06 ▲0.0436.38 ▼0.1233.91 ▼2.00
Add New Post /wp-admin/post-new.php1,538 ▼423.04 ▲4.77644.27 ▲50.2550.63 ▲4.16
Media Library /wp-admin/upload.php1,388 ▲34.22 ▲0.0597.54 ▼0.5748.42 ▲3.45
Code School Badges /wp-admin/options-general.php?page=wpcodeschool-badges8402.0624.7024.74

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
You still need to fix the following
  • The uninstall procedure has failed, leaving 7 options in the database
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_wpcodeschool_badges_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/code-school-badges/inc/front-end-shortcode.php
    • > /wp-content/plugins/code-school-badges/inc/front-end.php
  • 26× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Undefined variable: after_widget in wp-content/plugins/code-school-badges/inc/front-end.php on line 18
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/code-school-badges/inc/front-end-shortcode.php on line 5
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/code-school-badges/inc/front-end-shortcode.php on line 5
    • > PHP Warning
      array_reverse() expects parameter 1 to be array, null given in wp-content/plugins/code-school-badges/inc/front-end-shortcode.php on line 5
    • > PHP Notice
      Undefined variable: before_widget in wp-content/plugins/code-school-badges/inc/front-end-shortcode.php on line 2
    • > PHP Notice
      Undefined variable: after_title in wp-content/plugins/code-school-badges/inc/front-end-shortcode.php on line 3
    • > PHP Warning
      array_reverse() expects parameter 1 to be array, null given in wp-content/plugins/code-school-badges/inc/front-end.php on line 5
    • > PHP Notice
      Undefined variable: before_title in wp-content/plugins/code-school-badges/inc/front-end.php on line 3
    • > PHP Notice
      Undefined variable: after_title in wp-content/plugins/code-school-badges/inc/front-end.php on line 3
    • > PHP Notice
      Undefined variable: after_widget in wp-content/plugins/code-school-badges/inc/front-end-shortcode.php on line 18

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
8 plugin tags: api, badges, code school, shortcode, codeschool...

code-school-badges/wpcodeschool-badges.php 92% from 13 tests

The main file in "Code School Badges" v. 1.0.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("code-school-badges.php" instead of "wpcodeschool-badges.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
Good job! No executable or dangerous file extensions detected422 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP511167335
CSS151481
JavaScript1586

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity3.00
▷ Minimum class complexity3.00
▷ Maximum class complexity3.00
Average method complexity1.50
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
6 PNG files occupy 1.46MB with 1.09MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png142.20KB36.02KB▼ 74.67%
assets/screenshot-2.png142.99KB36.20KB▼ 74.69%
assets/screenshot-6.png419.94KB100.82KB▼ 75.99%
assets/screenshot-5.png225.54KB61.35KB▼ 72.80%
assets/screenshot-3.png356.96KB86.31KB▼ 75.82%