84% wp-code-pre

Code Review | WP Code Pre

WordPress plugin WP Code Pre scored 84% from 54 tests.

About plugin

  • Plugin page: wp-code-pre
  • Plugin version: 1.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.8
  • WordPress version: 6.3.1
  • First release: Sep 19, 2017
  • Latest release: Aug 8, 2021
  • Number of updates: 15
  • Update frequency: every 95.1 days
  • Top authors: zeshanb (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 869 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

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

Analyzing server-side resources used by WP Code Pre
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0136.32 ▼4.06
Dashboard /wp-admin3.31 ▲0.0145.56 ▼3.57
Posts /wp-admin/edit.php3.36 ▲0.0146.30 ▼0.22
Add New Post /wp-admin/post-new.php5.89 ▲0.0185.90 ▼6.64
Media Library /wp-admin/upload.php3.24 ▲0.0136.55 ▲5.39
About WP Code Pre /wp-admin/options-general.php?page=wp-code-pre-info-page3.2029.46

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for WP Code Pre
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲4713.24 ▼1.161.64 ▼0.3737.64 ▼3.25
Dashboard /wp-admin2,207 ▲225.83 ▼0.02100.31 ▲1.7940.34 ▼7.15
Posts /wp-admin/edit.php2,093 ▲42.01 ▼0.0034.96 ▼2.2732.79 ▼1.97
Add New Post /wp-admin/post-new.php1,517 ▼317.58 ▼5.55659.22 ▼78.3949.21 ▼10.45
Media Library /wp-admin/upload.php1,395 ▲44.21 ▲0.01101.19 ▲3.7244.85 ▼0.04
About WP Code Pre /wp-admin/options-general.php?page=wp-code-pre-info-page7612.1922.1824.41

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, 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
Almost there! Just fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/wp-code-pre/wp-code-pre.php:45

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
2 plugin tags: filter content, code highlight

wp-code-pre/wp-code-pre.php 92% from 13 tests

The entry point to "WP Code Pre" version 1.0 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Text Domain: The text domain name must use dashes instead of underscores, and it must be lowercase

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin32 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1211632

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions375.00%
▷ Anonymous functions125.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There were not PNG files found in your plugin