84% c3-random-quotes

Code Review | c3 Random Quotes

WordPress plugin c3 Random Quotes scored84%from 54 tests.

About plugin

  • Plugin page: c3-random-quotes
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Jan 27, 2015
  • Latest release: Jan 10, 2023
  • Number of updates: 18
  • Update frequency: every 161.4 days
  • Top authors: creed3 (100%)

Code review

54 tests

User reviews

10 reviews

Install metrics

200+ active /6,589 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼14.24ms] Passed 4 tests

This is a short check of server-side resources used by c3 Random Quotes
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0545.25 ▼5.25
Dashboard /wp-admin3.36 ▲0.0149.92 ▼19.75
Posts /wp-admin/edit.php3.41 ▲0.0551.55 ▼1.64
Add New Post /wp-admin/post-new.php5.94 ▲0.0589.39 ▼24.84
Media Library /wp-admin/upload.php3.28 ▲0.0536.02 ▼7.10

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 15 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_c3rq_widget
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for c3 Random Quotes
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,791 ▲3014.69 ▲0.141.76 ▼0.2835.22 ▼6.97
Dashboard /wp-admin2,198 ▲215.65 ▼0.0195.85 ▲6.4142.37 ▼0.45
Posts /wp-admin/edit.php2,100 ▼01.99 ▼0.0036.37 ▼3.0331.03 ▼7.05
Add New Post /wp-admin/post-new.php1,529 ▲323.43 ▲0.44674.44 ▲60.6956.60 ▼0.84
Media Library /wp-admin/upload.php1,400 ▼04.21 ▲0.02101.50 ▼17.3342.15 ▼3.34

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 does not fully uninstall, leaving 7 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • widget_c3rq_widget
    • can_compress_scripts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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
Please fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/c3-random-quotes/c3randomquotes.php:30

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)
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: Add images for these screenshots: #1 (The widget settings screen.), #2 (A quote displayed in a page header showing the white, leading quotation mark image.), #3 (A quote displayed in a page header showing the leading quotation mark as part of the quotation text.), #4 (A quote displayed in a sidebar showing the leading quotation mark as part of the quotation text.)
The official readme.txt might help

c3-random-quotes/c3randomquotes.php 92% from 13 tests

The main PHP script in "c3 Random Quotes" version 1.3 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("c3-random-quotes.php" instead of "c3randomquotes.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin137 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP13144134
CSS1003

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity28.00
▷ Minimum class complexity28.00
▷ Maximum class complexity28.00
Average method complexity7.75
▷ Minimum method complexity1.00
▷ Maximum method complexity14.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%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
11 PNG files occupy 0.08MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png11.96KB3.01KB▼ 74.83%
images/quote-yellow.png0.16KB0.18KB0.00%
screenshot-4.png18.11KB4.92KB▼ 72.83%
images/quote-black.png0.14KB0.18KB0.00%
images/quote-white.png0.16KB0.18KB0.00%