84% sample-content-generator

Code Review | Sample Data Generator

WordPress plugin Sample Data Generator scored84%from 54 tests.

About plugin

  • Plugin page: sample-content-ge...
  • Plugin version: 0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-3.9
  • WordPress version: 6.3.1
  • First release: Feb 28, 2014
  • Latest release: Jun 20, 2014
  • Number of updates: 5
  • Update frequency: every 22.8 days
  • Top authors: pko (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

20+ active /2,506 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
The plugin installed gracefully, with no errors

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

A check of server-side resources used by Sample Data Generator
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0437.78 ▼2.60
Dashboard /wp-admin3.35 ▲0.0549.41 ▼2.49
Posts /wp-admin/edit.php3.40 ▲0.0451.47 ▼2.97
Add New Post /wp-admin/post-new.php5.93 ▲0.0592.26 ▼12.09
Media Library /wp-admin/upload.php3.27 ▲0.0433.41 ▼2.59

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
db_upgraded
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Sample Data Generator
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.38 ▼0.211.91 ▲0.0143.79 ▼1.81
Dashboard /wp-admin2,189 ▲125.54 ▼0.0383.85 ▼4.1337.44 ▼7.03
Posts /wp-admin/edit.php2,100 ▼62.01 ▼0.0239.27 ▼12.0135.44 ▼8.64
Add New Post /wp-admin/post-new.php1,735 ▲20422.71 ▼0.46670.62 ▲2.0354.92 ▲0.43
Media Library /wp-admin/upload.php1,400 ▲34.33 ▲0.0997.37 ▼6.5843.08 ▼2.50

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/sample-content-generator/sample-content-generator.php:31

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention:
  • Screenshots: Screenshot #1 (Options for generating content) image missing
The official readme.txt is a good inspiration

sample-content-generator/sample-content-generator.php Passed 13 tests

The main PHP script in "Sample Data Generator" version 0.3 is automatically included on every request by WordPress
57 characters long description:
Generate sample lorem ipsum content with tiny MCE button.

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
There were no executable files found in this plugin304 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP23264178
PO File1202058
JavaScript17641
CSS17327

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity11.00
▷ Minimum class complexity11.00
▷ Maximum class complexity11.00
Average method complexity1.50
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods360.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
css/images/scg-icon.png1.40KB0.42KB▼ 70.06%