78% generate-dummy-posts

Code Review | Generate Dummy Posts

WordPress plugin Generate Dummy Posts scored78%from 54 tests.

About plugin

  • Plugin page: generate-dummy-posts
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.3
  • WordPress version: 6.3.1
  • First release: Jan 11, 2022
  • Latest release: Aug 9, 2023
  • Number of updates: 8
  • Update frequency: every 72.0 days
  • Top authors: sauravhny (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

1,000+ active /13,402 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▼7.16ms] Passed 4 tests

Server-side resources used by Generate Dummy Posts
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.0950.95 ▲6.01
Dashboard /wp-admin3.40 ▲0.0648.89 ▼17.94
Posts /wp-admin/edit.php3.45 ▲0.1048.95 ▼4.96
Add New Post /wp-admin/post-new.php5.98 ▲0.1093.75 ▼7.93
Media Library /wp-admin/upload.php3.33 ▲0.1037.98 ▲2.21
Generate Posts /wp-admin/options-general.php?page=gdposts3.3031.53

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Generate Dummy Posts
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲714.72 ▲0.451.76 ▼0.3043.45 ▼1.64
Dashboard /wp-admin2,202 ▲285.63 ▼0.0495.00 ▼0.0040.42 ▲0.07
Posts /wp-admin/edit.php2,104 ▲42.04 ▲0.0939.70 ▼1.7134.46 ▼6.43
Add New Post /wp-admin/post-new.php1,529 ▲322.92 ▼0.64675.47 ▲73.3253.92 ▼2.90
Media Library /wp-admin/upload.php1,407 ▲74.18 ▼0.0098.37 ▼3.9045.95 ▲2.87
Generate Posts /wp-admin/options-general.php?page=gdposts8282.1329.5129.44

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts

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
Smoke test failed, please fix the following
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=gdposts
    • > request to
    • > Notice in wp-config.php+20
    Undefined index: REQUEST_METHOD

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
Please fix the following
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/generate-dummy-posts/gdp.php:34
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/generate-dummy-posts/include/main.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
7 plugin tags: dummy, placeholder, lorem, posts, generator...

generate-dummy-posts/gdp.php 85% from 13 tests

This is the main PHP file of "Generate Dummy Posts" version 1.0.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("generate-dummy-posts.php" instead of "gdp.php")
  • Domain Path: The domain path is invalid: folder "/languages" does not exist

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 detected182 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP23072113
CSS11240
JavaScript15329

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.12
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%
Functions8
▷ Named functions8100.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
No PNG images were found in this plugin