83% viavi-dummy-content-generator

Code Review | Viavi Dummy Content Generator

WordPress plugin Viavi Dummy Content Generator scored83%from 54 tests.

About plugin

  • Plugin page: viavi-dummy-conte...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.4.0
  • WordPress version: 6.3.1
  • First release: Mar 5, 2014
  • Latest release: Dec 22, 2015
  • Number of updates: 8
  • Update frequency: every 82.3 days
  • Top authors: viaviwebtech (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,519 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.03MB] [CPU: ▲0.78ms] Passed 4 tests

Server-side resources used by Viavi Dummy Content Generator
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0339.42 ▼4.84
Dashboard /wp-admin3.37 ▲0.0358.80 ▲3.87
Posts /wp-admin/edit.php3.49 ▲0.0954.03 ▲2.16
Add New Post /wp-admin/post-new.php5.96 ▲0.0399.30 ▲5.44
Media Library /wp-admin/upload.php3.30 ▲0.0337.19 ▲1.95

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 6 new files
Database: 1 new table, 6 new options
New tables
viavi_dummy_content
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
db_upgraded
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Viavi Dummy Content Generator
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲4314.25 ▼0.031.86 ▲0.1945.55 ▲6.31
Dashboard /wp-admin2,198 ▲215.64 ▲0.0388.71 ▲0.8067.09 ▲24.04
Posts /wp-admin/edit.php2,121 ▲211.98 ▼0.0438.03 ▲2.6432.91 ▼4.09
Add New Post /wp-admin/post-new.php1,557 ▲2923.70 ▲0.70695.16 ▲78.4151.40 ▼8.76
Media Library /wp-admin/upload.php1,418 ▲184.16 ▼0.0298.03 ▼8.9773.32 ▲29.33

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
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check 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 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/viavi-dummy-content-generator/dummy_content_form.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/viavi-dummy-content-generator/dummy_content.php:16

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

readme.txt 81% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === viavi-dummy-content-generator === )
  • Screenshots: Screenshot #1 (Dummy Content Setting) image missing
  • Donate link: Please fix this invalid URI: ""
Please take inspiration from this readme.txt

viavi-dummy-content-generator/dummy_content.php 92% from 13 tests

This is the main PHP file of "Viavi Dummy Content Generator" version 1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
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 ("viavi-dummy-content-generator.php" instead of "dummy_content.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected133 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP32514133

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.11
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%
Functions10
▷ Named functions10100.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
2 PNG files occupy 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
icon.png1.44KB0.71KB▼ 51.12%
screenshot-1.png29.78KB13.80KB▼ 53.67%