68% fakerpress

Code Review | FakerPress

WordPress plugin FakerPress scored68%from 54 tests.

About plugin

  • Plugin page: fakerpress
  • Plugin version: 0.6.1
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-6.2
  • WordPress version: 6.3.1
  • First release: Jun 17, 2014
  • Latest release: Apr 4, 2023
  • Number of updates: 75
  • Update frequency: every 44.2 days
  • Top authors: bordoni (86.67%)iryz (14.67%)

Code review

54 tests

User reviews

196 reviews

Install metrics

20,000+ active /544,904 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.23MB] [CPU: ▼1.42ms] Passed 4 tests

A check of server-side resources used by FakerPress
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.68 ▲0.2238.80 ▼2.07
Dashboard /wp-admin3.59 ▲0.2850.51 ▲4.19
Posts /wp-admin/edit.php3.64 ▲0.2845.43 ▼0.03
Add New Post /wp-admin/post-new.php6.10 ▲0.2287.49 ▼7.78
Media Library /wp-admin/upload.php3.45 ▲0.2237.83 ▲7.23
Comments /wp-admin/admin.php?page=fakerpress&view=comments4.6360.71
Settings /wp-admin/admin.php?page=fakerpress3.4631.95
Users /wp-admin/admin.php?page=fakerpress&view=users4.0233.94
Terms /wp-admin/admin.php?page=fakerpress&view=terms4.0135.24
Posts /wp-admin/admin.php?page=fakerpress&view=posts4.1533.64

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

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

Browser metrics Passed 4 tests

Checking browser requirements for FakerPress
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,830 ▲6914.37 ▼0.161.72 ▲0.1246.94 ▲6.91
Dashboard /wp-admin2,230 ▲535.57 ▼0.0986.49 ▼1.0341.43 ▼0.21
Posts /wp-admin/edit.php2,138 ▲382.00 ▲0.0134.21 ▼4.4937.29 ▲3.87
Add New Post /wp-admin/post-new.php1,560 ▲3423.13 ▼0.41585.26 ▼82.4044.37 ▼14.76
Media Library /wp-admin/upload.php1,438 ▲384.28 ▲0.0794.68 ▼3.7543.41 ▼4.15
Comments /wp-admin/admin.php?page=fakerpress&view=comments2,2233.2064.8744.82
Settings /wp-admin/admin.php?page=fakerpress9122.1728.1042.80
Users /wp-admin/admin.php?page=fakerpress&view=users1,5232.5948.4637.81
Terms /wp-admin/admin.php?page=fakerpress&view=terms1,3872.5044.9837.14
Posts /wp-admin/admin.php?page=fakerpress&view=posts2,9703.6288.8049.76

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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 take a closer look at the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/fakerpress/src/templates/fields/components/container/end.php
  • 669× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Faker\\Provider\\Payment' not found in wp-content/plugins/fakerpress/vendor/fakerphp/faker/src/Faker/Provider/fi_FI/Payment.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'Carbon\\Exceptions\\InvalidArgumentException' not found in wp-content/plugins/fakerpress/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidFormatException.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Faker\\Provider\\PhoneNumber' not found in wp-content/plugins/fakerpress/vendor/fakerphp/faker/src/Faker/Provider/fr_FR/PhoneNumber.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Doctrine\\DBAL\\Types\\VarDateTimeType' not found in wp-content/plugins/fakerpress/vendor/nesbot/carbon/src/Carbon/Doctrine/DateTimeType.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Faker\\Provider\\PhoneNumber' not found in wp-content/plugins/fakerpress/vendor/fakerphp/faker/src/Faker/Provider/de_DE/PhoneNumber.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Faker\\Provider\\Address' not found in wp-content/plugins/fakerpress/vendor/fakerphp/faker/src/Faker/Provider/th_TH/Address.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Faker\\Provider\\Company' not found in wp-content/plugins/fakerpress/vendor/fakerphp/faker/src/Faker/Provider/ar_SA/Company.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Faker\\Provider\\Base' not found in wp-content/plugins/fakerpress/vendor/fakerphp/faker/src/Faker/Provider/Internet.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Faker\\Provider\\PhoneNumber' not found in wp-content/plugins/fakerpress/vendor/fakerphp/faker/src/Faker/Provider/fa_IR/PhoneNumber.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Faker\\Provider\\PhoneNumber' not found in wp-content/plugins/fakerpress/vendor/fakerphp/faker/src/Faker/Provider/hu_HU/PhoneNumber.php:5

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)
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed:
  • Tags: Please reduce the number of tags, currently 21 tag instead of maximum 10
The official readme.txt might help

fakerpress/fakerpress.php Passed 13 tests

This is the main PHP file of "FakerPress" version 0.6.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
117 characters long description:
FakerPress is a clean way to generate fake data to your WordPress installation, great for developers who need testing

Code Analysis 3% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Almost there! Just fix the following issues
  • Even if your plugin relies on executable files (for example a companion app), never distribute executable files with your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/fakerpress/vendor/nesbot/carbon/bin/carbon.bat
159,526 lines of code in 1,491 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,44530,95643,592151,766
XSD392482,803
Markdown1471701,759
JSON12001,327
JavaScript8311801,047
CSS612422562
XML100247
SVG10011
DOS Batch1004

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
The following items need your attention
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 140)
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity6.76
▷ Minimum class complexity1.00
▷ Maximum class complexity323.00
Average method complexity2.28
▷ Minimum method complexity1.00
▷ Maximum method complexity140.00
Code structure
Namespaces129
Interfaces51
Traits29
Classes686
▷ Abstract classes202.92%
▷ Concrete classes66697.08%
▷ Final classes294.35%
Methods3,619
▷ Static methods1,27035.09%
▷ Public methods3,23889.47%
▷ Protected methods2085.75%
▷ Private methods1734.78%
Functions505
▷ Named functions12524.75%
▷ Anonymous functions38075.25%
Constants166
▷ Global constants95.42%
▷ Class constants15794.58%
▷ Public constants15498.09%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 compressed PNG files occupy 0.00MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
src/resources/vendor/select2/select2x2.png0.83KB0.77KB▼ 6.15%
src/resources/vendor/select2/select2.png0.60KB0.99KB0.00%