10% xv-random-quotes

Code Review | XV Random Quotes

WordPress plugin XV Random Quotes scored10%from 54 tests.

About plugin

  • Plugin page: xv-random-quotes
  • Plugin version: 1.37
  • PHP version: 7.4.16
  • WordPress compatibility: 2.3-5.7
  • WordPress version: 6.3.1
  • First release: Aug 18, 2015
  • Latest release: May 16, 2021
  • Number of updates: 31
  • Update frequency: every 67.8 days
  • Top authors: xavivars (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

400+ active /5,832 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
You still need to fix the following installer errors
  • Install procedure had errors
    • > Notice in wp-content/plugins/xv-random-quotes/lib/class.constants.php+14
    Constant XV_RANDOMQUOTES_TABLE already defined

Server metrics [RAM: ▼1.79MB] [CPU: ▼58.84ms] Passed 4 tests

Server-side resources used by XV Random Quotes
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.20 ▼1.264.78 ▼40.83
Dashboard /wp-admin2.22 ▼1.126.04 ▼56.53
Posts /wp-admin/edit.php2.22 ▼1.135.77 ▼46.13
Add New Post /wp-admin/post-new.php2.22 ▼3.665.75 ▼91.87
Media Library /wp-admin/upload.php2.22 ▼1.006.77 ▼30.55
Add New /wp-admin/admin.php?page=stray_new2.226.90
Overview /wp-admin/admin.php?page=xv-random-quotes/xv-random-quotes.php2.226.49
Tools /wp-admin/admin.php?page=stray_tools2.227.06
Settings /wp-admin/admin.php?page=stray_quotes_options2.226.82
Manage /wp-admin/admin.php?page=stray_manage2.225.92
Remove /wp-admin/admin.php?page=stray_remove2.226.45
Help /wp-admin/admin.php?page=xv_random_quotes_help2.225.52

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 36 new files
Database: 1 new table, 8 new options
New tables
wp_stray_quotes
New WordPress options
widget_recent-posts
widget_stray_quotes
theysaidso_admin_options
widget_theysaidso_widget
stray_quotes_options
can_compress_scripts
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by XV Random Quotes
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,923 ▲15213.51 ▼1.228.35 ▲6.3938.02 ▼5.36
Dashboard /wp-admin2,243 ▲725.54 ▼0.0485.15 ▼5.7180.90 ▲40.48
Posts /wp-admin/edit.php2,148 ▲482.00 ▲0.0235.37 ▼2.3734.44 ▼3.33
Add New Post /wp-admin/post-new.php1,717 ▲19122.27 ▼0.58665.15 ▼5.6849.51 ▼2.35
Media Library /wp-admin/upload.php1,445 ▲454.24 ▲0.03100.91 ▼12.5574.03 ▲25.36
Add New /wp-admin/admin.php?page=stray_new9601.6623.3536.05
Overview /wp-admin/admin.php?page=xv-random-quotes/xv-random-quotes.php9062.1727.1629.76
Tools /wp-admin/admin.php?page=stray_tools1,0132.1921.8927.65
Settings /wp-admin/admin.php?page=stray_quotes_options1,5072.0225.5037.21
Manage /wp-admin/admin.php?page=stray_manage1,0821.7423.9926.56
Remove /wp-admin/admin.php?page=stray_remove8672.0124.0726.94
Help /wp-admin/admin.php?page=xv_random_quotes_help1,3292.1823.0729.36

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/xv-random-quotes/lib/class.constants.php+14
    Constant XV_RANDOMQUOTES_TABLE already defined
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_stray_quotes
  • Zombie WordPress options were found after uninstall: 9 options
    • widget_recent-comments
    • widget_recent-posts
    • aep_start_date
    • theysaidso_admin_options
    • widget_stray_quotes
    • stray_quotes_options
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These errors were triggered by the plugin
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=xv_random_quotes_help
    • > Notice in wp-content/plugins/xv-random-quotes/lib/class.constants.php+14
    Constant XV_RANDOMQUOTES_TABLE already defined
    • > GET request to /wp-admin/admin.php?page=stray_tools
    • > Notice in wp-content/plugins/xv-random-quotes/inc/stray_tools.php+169
    Undefined variable: websource_selected
    • > GET request to /wp-admin/admin.php?page=stray_tools
    • > Notice in wp-content/plugins/xv-random-quotes/inc/stray_tools.php+183
    Undefined variable: comment_scode_selected
    • > GET request to /wp-admin/admin.php?page=stray_tools
    • > Notice in wp-content/plugins/xv-random-quotes/inc/stray_tools.php+185
    Undefined variable: title_scode_selected
    • > GET request to /wp-admin/admin.php?page=stray_tools
    • > Notice in wp-content/plugins/xv-random-quotes/inc/stray_tools.php+187
    Undefined variable: excerpt_scode_selected
    • > GET request to /wp-admin/admin.php?page=stray_tools
    • > Notice in wp-content/plugins/xv-random-quotes/inc/stray_tools.php+189
    Undefined variable: categories_scode_selected
    • > GET request to /wp-admin/admin.php?page=stray_tools
    • > Notice in wp-content/plugins/xv-random-quotes/inc/stray_tools.php+191
    Undefined variable: tags_scode_selected
    • > GET request to /wp-admin/admin.php?page=stray_tools
    • > Notice in wp-content/plugins/xv-random-quotes/inc/stray_tools.php+193
    Undefined variable: bloginfo_scode_selected
    • > GET request to /wp-admin/admin.php?page=stray_tools
    • > Notice in wp-content/plugins/xv-random-quotes/inc/stray_tools.php+195
    Undefined variable: widget_scode_selected
    • > GET request to /wp-admin/admin.php?page=stray_quotes_options
    • > Notice in wp-content/plugins/xv-random-quotes/inc/stray_settings.php+119
    Undefined index: stray_quotes_regular_title
    • > GET request to /wp-admin/admin.php?page=stray_quotes_options
    • > Notice in wp-content/plugins/xv-random-quotes/inc/stray_settings.php+120
    Undefined index: stray_quotes_widget_title
    • > GET request to /wp-admin/admin.php?page=stray_quotes_options
    • > Notice in wp-content/plugins/xv-random-quotes/inc/stray_settings.php+256
    Undefined variable: strayajax_selected
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=stray_quotes_options
    • > Notice in wp-content/plugins/xv-random-quotes/inc/stray_settings.php+350
    Undefined variable: urlcategory
    • > GET request to /wp-admin/admin.php?page=stray_quotes_options
    • > Notice in wp-content/plugins/xv-random-quotes/inc/stray_settings.php+375
    Undefined variable: multiuser_selected
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=stray_manage
    • > Notice in wp-content/plugins/xv-random-quotes/inc/stray_manage.php+376
    Undefined index: bulk
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=stray_manage
    • > Notice in wp-content/plugins/xv-random-quotes/inc/stray_manage.php+669
    Undefined variable: first
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=stray_manage
    • > Notice in wp-content/plugins/xv-random-quotes/inc/stray_manage.php+669
    Undefined variable: last
    • > GET request to /wp-admin/admin.php?page=stray_remove
    • > Notice in wp-content/plugins/xv-random-quotes/inc/stray_remove.php+9
    Undefined index: mode

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
Almost there! Just fix the following items
  • 11× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/xv-random-quotes/inc/stray_ajax.php:3
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/xv-random-quotes/lib/class.constants.php on line 11
    • > PHP Notice
      Constant XV_RANDOMQUOTES_TABLE already defined in wp-content/plugins/xv-random-quotes/lib/class.constants.php on line 14
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/xv-random-quotes/lib/class.constants.php on line 13
    • > PHP Notice
      Constant XV_RANDOMQUOTES_TABLE already defined in wp-content/plugins/xv-random-quotes/lib/class.constants.php on line 14
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/xv-random-quotes/lib/class.constants.php on line 13
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/xv-random-quotes/lib/class.constants.php on line 14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/xv-random-quotes/xv-random-quotes.php:19
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/xv-random-quotes/lib/class.constants.php on line 11
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/xv-random-quotes/lib/class.constants.php on line 14

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 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Screenshots: Add images for these screenshots: #1 (How the management page works.), #2 (How to add a new quote.), #3 (A random quote in the sidebar.), #4 (Bulk editing in the Management page.), #5 (The bookmarklet in the Tools page.), #6 (The Settings page.), #7 (The widget options.)
Please take inspiration from this readme.txt

xv-random-quotes/xv-random-quotes.php Passed 13 tests

"XV Random Quotes" version 1.37's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
66 characters long description:
Displays and rotatse quotes and expressions anywhere in your blog.

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 plugin5,120 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP137193732,568
PO File41,0381,8352,316
JavaScript23026236

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity11.25
▷ Minimum class complexity1.00
▷ Maximum class complexity39.00
Average method complexity4.15
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods13
▷ Static methods00.00%
▷ Public methods861.54%
▷ Protected methods00.00%
▷ Private methods538.46%
Functions27
▷ Named functions27100.00%
▷ Anonymous functions00.00%
Constants20
▷ Global constants1575.00%
▷ Class constants525.00%
▷ Public constants5100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
10 PNG files occupy 0.10MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png13.20KB9.80KB▼ 25.76%
screenshot-5.png14.89KB11.35KB▼ 23.78%
screenshot-7.png14.30KB10.53KB▼ 26.37%
screenshot-2.png14.51KB11.18KB▼ 22.95%
img/lightbulb.png0.76KB0.81KB0.00%