84% factoid

Code Review | Factoid

WordPress plugin Factoid scored 84% from 54 tests.

About plugin

  • Plugin page: factoid
  • Plugin version: 1.14
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.9.2
  • WordPress version: 5.8.1
  • First release: Nov 14, 2014
  • Latest release: Jan 29, 2018
  • Number of updates: 28
  • Update frequency: every 41.9 days
  • Top authors: delahoc (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active / 1,603 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.06MB] [CPU: ▼134.33ms] Passed 4 tests

Server-side resources used by Factoid
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.91 ▲0.0739.00 ▲2.74
Dashboard /wp-admin3.13 ▲0.0753.78 ▲4.44
Posts /wp-admin/edit.php3.18 ▲0.0751.30 ▲4.27
Add New Post /wp-admin/post-new.php5.49 ▲0.05106.56 ▼548.78
Media Library /wp-admin/upload.php3.07 ▲0.0740.18 ▲4.57
Factoid /wp-admin/options-general.php?page=wp_factoid_plugin3.0630.77

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 5 new files
Database: no new tables, 1 new option
New WordPress options
widget_factoid_widget

Browser metrics Passed 4 tests

Checking browser requirements for Factoid
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,820 ▲22416.86 ▲1.0018.19 ▲7.3351.82 ▲3.77
Dashboard /wp-admin2,972 ▲435.88 ▼0.09142.21 ▼6.41110.01 ▼2.21
Posts /wp-admin/edit.php2,741 ▲22.68 ▼0.0166.75 ▼3.5896.35 ▲5.42
Add New Post /wp-admin/post-new.php1,686 ▼1,95018.77 ▲3.85395.97 ▼61.26123.42 ▲14.20
Media Library /wp-admin/upload.php1,738 ▼695.00 ▼0.01159.29 ▼7.14130.60 ▲9.87
Factoid /wp-admin/options-general.php?page=wp_factoid_plugin1,4272.8061.6177.48

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 1 option in the database
    • widget_factoid_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 | 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
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/factoid/factoid.php:177
    • > PHP Fatal error
      Uncaught Error: Class 'WP_octo_factoid' not found in wp-content/plugins/factoid/factoidsettings.php:2

User-side errors Passed 1 test

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

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
5 plugin tags: quotes, random, facts, content, trivia

factoid/factoid.php Passed 13 tests

The principal PHP file in "Factoid" v. 1.14 is loaded by WordPress automatically on each request
71 characters long description:
Place random quotes or facts on your site through shortcodes or widgets

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 detected1,059 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP24994514
CSS1677349
JavaScript1723196

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.16
Average class complexity13.50
▷ Minimum class complexity6.00
▷ Maximum class complexity21.00
Average method complexity3.08
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods12
▷ Static methods216.67%
▷ Public methods12100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.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
No PNG files were detected