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: 5.8.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,087 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
It is recommended to fix the following installer errors
  • The plugin did not install without errors
    • > 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: ▼146.11ms] Passed 4 tests

Analyzing server-side resources used by Code School Badges
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.86 ▲0.0225.72 ▲0.16
Dashboard /wp-admin3.07 ▲0.0134.61 ▼5.55
Posts /wp-admin/edit.php3.13 ▲0.0232.00 ▼1.52
Add New Post /wp-admin/post-new.php5.44 ▼0.0070.82 ▼577.53
Media Library /wp-admin/upload.php3.02 ▲0.0125.33 ▲1.01
Code School Badges /wp-admin/options-general.php?page=wpcodeschool-badges3.0623.38

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 15 new files
Database: no new tables, 1 new option
New WordPress options
widget_wpcodeschool_badges_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Code School Badges
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,853 ▲25216.00 ▲0.2012.24 ▲7.2675.34 ▼1.82
Dashboard /wp-admin2,952 ▲566.10 ▼0.11112.50 ▼14.86164.02 ▼7.32
Posts /wp-admin/edit.php2,738 ▼23.25 ▼0.1164.56 ▲2.90132.64 ▼2.11
Add New Post /wp-admin/post-new.php3,818 ▲319.12 ▼0.23415.02 ▼10.24163.12 ▼5.91
Media Library /wp-admin/upload.php1,807 ▲525.55 ▲0.01138.36 ▼1.80183.54 ▼2.34
Code School Badges /wp-admin/options-general.php?page=wpcodeschool-badges1,2402.4156.01111.30

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 1 option in the database
    • 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
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
Almost there! Just fix the following items
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/code-school-badges/inc/front-end.php
    • > /wp-content/plugins/code-school-badges/inc/front-end-shortcode.php
  • 26× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: before_widget in wp-content/plugins/code-school-badges/inc/front-end.php on line 2
    • > PHP Notice
      Undefined variable: before_title in wp-content/plugins/code-school-badges/inc/front-end-shortcode.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
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/code-school-badges/wpcodeschool-badges.php:37
    • > PHP Notice
      Undefined variable: wpcodeschool_profile in wp-content/plugins/code-school-badges/inc/front-end.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/code-school-badges/inc/options-page-wrapper.php:38
    • > PHP Notice
      Undefined variable: before_title in wp-content/plugins/code-school-badges/inc/front-end.php on line 3
    • > PHP Warning
      count(): Parameter must be an array or an object that implements Countable in wp-content/plugins/code-school-badges/inc/front-end.php on line 6
    • > PHP Notice
      Undefined variable: after_title in wp-content/plugins/code-school-badges/inc/front-end-shortcode.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
8 plugin tags: code school, profile, shortcode, badges, education...

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

This is the main PHP file of "Code School Badges" version 1.0.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to 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 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin422 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP511167335
CSS151481
JavaScript1586

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
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-2.png142.99KB36.20KB▼ 74.69%
assets/screenshot-6.png419.94KB100.82KB▼ 75.99%
assets/screenshot-3.png356.96KB86.31KB▼ 75.82%
assets/screenshot-1.png142.20KB36.02KB▼ 74.67%
assets/screenshot-4.png207.74KB56.91KB▼ 72.60%