94% wp-lorem-ipsum-generator

Code Review | Lorem Ipsum Generator

WordPress plugin Lorem Ipsum Generator scored 94% from 54 tests.

About plugin

  • Plugin page: wp-lorem-ipsum-ge...
  • Plugin version: 0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-3.9.2
  • WordPress version: 5.8.1
  • First release: Jul 8, 2011
  • Latest release: Jul 23, 2014
  • Number of updates: 17
  • Update frequency: every 65.4 days
  • Top authors: jonnyvaughan (100%)

Code review

54 tests

User reviews

10 reviews

Install metrics

1,000+ active / 16,083 total downloads

Benchmarks

Plugin footprint Passed 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.00MB] [CPU: ▼140.52ms] Passed 4 tests

An overview of server-side resources used by Lorem Ipsum Generator
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.85 ▲0.1235.11 ▲10.12
Dashboard /wp-admin3.07 ▲0.0147.29 ▲5.00
Posts /wp-admin/edit.php3.12 ▲0.0146.22 ▲1.23
Add New Post /wp-admin/post-new.php5.43 ▼0.0186.72 ▼567.91
Media Library /wp-admin/upload.php3.01 ▲0.0132.00 ▼0.38

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 7 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Lorem Ipsum Generator: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,679 ▲8315.94 ▲0.4011.11 ▼0.6344.16 ▼11.81
Dashboard /wp-admin2,967 ▲365.88 ▼0.06140.10 ▼4.16112.10 ▼7.73
Posts /wp-admin/edit.php2,739 ▼02.71 ▲0.0063.88 ▼5.1990.57 ▼0.69
Add New Post /wp-admin/post-new.php1,872 ▲25719.12 ▼2.35357.28 ▲82.24106.17 ▲3.80
Media Library /wp-admin/upload.php1,807 ▼05.06 ▲0.04147.71 ▲5.90113.52 ▼13.96

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
The following issues need your attention
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-lorem-ipsum-generator/index.php:55
    • > PHP Notice
      Undefined index: words in wp-content/plugins/wp-lorem-ipsum-generator/ajax_load.php on line 6

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

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
2 plugin tags: lorem ipsum generator, lorem ipsum

wp-lorem-ipsum-generator/index.php 92% from 13 tests

The main PHP script in "Lorem Ipsum Generator" version 0.3 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wp-lorem-ipsum-generator.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected410 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP36087379
JavaScript25131

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity26.00
▷ Minimum class complexity26.00
▷ Maximum class complexity26.00
Average method complexity2.79
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods14
▷ Static methods00.00%
▷ Public methods214.29%
▷ Protected methods00.00%
▷ Private methods1285.71%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
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
images/icon.png0.22KB0.15KB▼ 34.65%