10% content-randomizer

Code Review | Content Randomizer

WordPress plugin Content Randomizer scored10%from 54 tests.

About plugin

  • Plugin page: content-randomizer
  • Plugin version: 1.2.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.9.2
  • WordPress version: 6.3.1
  • First release: Aug 23, 2015
  • Latest release: Jan 21, 2018
  • Number of updates: 20
  • Update frequency: every 44.1 days
  • Top authors: dominykasgel (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

400+ active /7,366 total downloads

Benchmarks

Plugin footprint 40% 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 cannot be installed
    • > Deprecated in wp-content/plugins/content-randomizer/includes/widgets.php+234
    Function create_function() is deprecated

Server metrics [RAM: ▼1.83MB] [CPU: ▼54.57ms] Passed 4 tests

This is a short check of server-side resources used by Content Randomizer
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.16 ▼1.305.09 ▼34.49
Dashboard /wp-admin2.18 ▼1.126.37 ▼45.24
Posts /wp-admin/edit.php2.18 ▼1.175.82 ▼44.87
Add New Post /wp-admin/post-new.php2.18 ▼3.707.00 ▼93.69
Media Library /wp-admin/upload.php2.18 ▼1.056.33 ▼27.49
Categories /wp-admin/edit-tags.php?taxonomy=randomizer_category&post_type=elm_texts2.188.18
All Items /wp-admin/edit.php?post_type=elm_texts2.187.20
Add New /wp-admin/post-new.php?post_type=elm_texts2.186.64

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 20 new files
Database: no new tables, 11 new options
New WordPress options
db_upgraded
elm_randomizer_version
widget_randomizer_widget
widget_recent-comments
theysaidso_admin_options
widget_randomizerslideshow_widget
elm_randomizer_permalinks
elm_randomizer
widget_recent-posts
widget_theysaidso_widget
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Content Randomizer
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,945 ▲19914.00 ▼0.288.93 ▲7.0544.19 ▼0.32
Dashboard /wp-admin2,237 ▲495.90 ▲0.04110.11 ▼2.2742.70 ▼0.80
Posts /wp-admin/edit.php2,120 ▲312.02 ▲0.0037.43 ▼0.5635.31 ▲0.55
Add New Post /wp-admin/post-new.php1,569 ▲17718.22 ▼0.19662.72 ▲26.5759.44 ▲11.78
Media Library /wp-admin/upload.php1,416 ▲314.14 ▼0.00109.24 ▼31.3346.82 ▼6.90
Categories /wp-admin/edit-tags.php?taxonomy=randomizer_category&post_type=elm_texts1,2902.1426.9428.06
All Items /wp-admin/edit.php?post_type=elm_texts1,1011.9430.8129.93
Add New /wp-admin/post-new.php?post_type=elm_texts2,3538.05183.2271.46

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin cannot be uninstalled
    • > Deprecated in wp-content/plugins/content-randomizer/includes/widgets.php+234
    Function create_function() is deprecated
  • The uninstall procedure has failed, leaving 11 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_randomizer_widget
    • elm_randomizer_version
    • elm_randomizer
    • theysaidso_admin_options
    • widget_randomizerslideshow_widget
    • db_upgraded
    • elm_randomizer_permalinks
    • ...

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Please fix the following server-side errors
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=elm_texts
    • > Deprecated in wp-content/plugins/content-randomizer/includes/widgets.php+237
    Function create_function() is deprecated
    • > GET request to /wp-admin/post-new.php?post_type=elm_texts
    • > Notice in wp-content/plugins/content-randomizer/randomizer.php+117
    Undefined index: date_from
    • > GET request to /wp-admin/post-new.php?post_type=elm_texts
    • > Notice in wp-content/plugins/content-randomizer/randomizer.php+118
    Undefined index: date_to

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
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/content-randomizer/includes/widgets.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/content-randomizer/includes/shortcodes.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/content-randomizer/plugin.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed:
  • Tags: You are using too many tags: 12 tag instead of maximum 10
  • Plugin Name: You should set the name of your plugin on the first line ( === content-randomizer === )
You can look at the official readme.txt

content-randomizer/plugin.php 92% from 13 tests

The primary PHP file in "Content Randomizer" version 1.2.3 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("content-randomizer.php" instead of "plugin.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
No dangerous file extensions were detected2,600 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript24508571,764
PHP5129180490
CSS2918242
PO File144399
XML1005

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity15.00
▷ Minimum class complexity8.00
▷ Maximum class complexity28.00
Average method complexity2.93
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods29
▷ Static methods00.00%
▷ Public methods29100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.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
2 PNG files occupy 0.28MB with 0.17MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/banner-772x250.png87.81KB32.51KB▼ 62.98%
assets/banner-1544x500.png195.54KB75.71KB▼ 61.28%