78% fakerpress

Code Review | FakerPress

WordPress plugin FakerPress scored 78% from 54 tests.

About plugin

  • Plugin page: fakerpress
  • Plugin version: 0.5.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.9.1
  • WordPress version: 5.9.2
  • First release: Jun 17, 2014
  • Latest release: Mar 4, 2022
  • Number of updates: 71
  • Update frequency: every 39.7 days
  • Top authors: bordoni (85.92%)iryz (15.49%)

Code review

54 tests

User reviews

190 reviews

Install metrics

20,000+ active / 408,322 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲2.11MB] [CPU: ▼263.59ms] Passed 4 tests

Analyzing server-side resources used by FakerPress
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.04 ▲0.5357.75 ▼0.21
Dashboard /wp-admin6.07 ▲2.6645.83 ▲11.20
Posts /wp-admin/edit.php6.29 ▲2.6582.52 ▲47.18
Add New Post /wp-admin/post-new.php9.59 ▲2.62169.69 ▼1,083.90
Media Library /wp-admin/upload.php6.01 ▲2.7243.23 ▲18.55
Comments /wp-admin/admin.php?page=fakerpress&view=comments7.5743.24
Settings /wp-admin/admin.php?page=fakerpress6.7744.20
Users /wp-admin/admin.php?page=fakerpress&view=users7.6746.42
Terms /wp-admin/admin.php?page=fakerpress&view=terms7.6542.37
Posts /wp-admin/admin.php?page=fakerpress&view=posts7.5972.90

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for FakerPress
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,834 ▲11215.92 ▲0.545.58 ▼0.072.30 ▲0.05
Dashboard /wp-admin2,943 ▲826.25 ▲0.05124.15 ▼12.65177.52 ▼68.00
Posts /wp-admin/edit.php2,740 ▲463.05 ▼0.1869.43 ▲6.70346.64 ▲207.64
Add New Post /wp-admin/post-new.php1,710 ▲4921.84 ▲5.05451.32 ▼2.80229.14 ▲26.43
Media Library /wp-admin/upload.php1,746 ▲515.47 ▼0.05169.59 ▲15.81230.11 ▼3.06
Comments /wp-admin/admin.php?page=fakerpress&view=comments2,5444.08100.24195.70
Settings /wp-admin/admin.php?page=fakerpress1,1523.2961.08151.51
Users /wp-admin/admin.php?page=fakerpress&view=users1,8843.6582.17176.04
Terms /wp-admin/admin.php?page=fakerpress&view=terms1,7193.5377.48171.48
Posts /wp-admin/admin.php?page=fakerpress&view=posts3,4114.21118.01212.35

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Uninstaller ran successfully

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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× PHP files output text when accessed directly:
    • > /wp-content/plugins/fakerpress/vendor/symfony/translation/Resources/bin/translation-status.php
    • > /wp-content/plugins/fakerpress/src/templates/fields/components/container/end.php
  • 559× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Faker\\Provider\\Address' not found in wp-content/plugins/fakerpress/vendor/fzaninotto/faker/src/Faker/Provider/sr_Cyrl_RS/Address.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Faker\\Provider\\Base' not found in wp-content/plugins/fakerpress/src/FakerPress/Provider/WP_User.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Faker\\Provider\\Internet' not found in wp-content/plugins/fakerpress/vendor/fzaninotto/faker/src/Faker/Provider/it_IT/Internet.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Faker\\Provider\\Internet' not found in wp-content/plugins/fakerpress/vendor/fzaninotto/faker/src/Faker/Provider/es_ES/Internet.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/fakerpress/vendor/symfony/translation/Tests/DependencyInjection/TranslationPassTest.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Faker\\Provider\\Base' not found in wp-content/plugins/fakerpress/src/FakerPress/Provider/WP_Term.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'FakerPress\\Fields\\Field_Interface' not found in wp-content/plugins/fakerpress/src/FakerPress/Fields/Field_Abstract.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Faker\\Provider\\PhoneNumber' not found in wp-content/plugins/fakerpress/vendor/fzaninotto/faker/src/Faker/Provider/sk_SK/PhoneNumber.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Faker\\Provider\\Person' not found in wp-content/plugins/fakerpress/vendor/fzaninotto/faker/src/Faker/Provider/ru_RU/Person.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Faker\\Provider\\Base' not found in wp-content/plugins/fakerpress/vendor/fzaninotto/faker/src/Faker/Provider/Payment.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Tags: There are too many tags (21 tag instead of maximum 10)
You can take inspiration from this readme.txt

fakerpress/fakerpress.php Passed 13 tests

The main PHP file in "FakerPress" ver. 0.5.3 adds more information about the plugin and also serves as the entry point for this plugin
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 | There should be no dangerous file extensions present in any WordPress plugin
Please make sure to remedy the following
  • For security reasons, never distribute binary or executable files with your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/fakerpress/vendor/nesbot/carbon/bin/upgrade-carbon.bat
178,197 lines of code in 904 files:
LanguageFilesBlank linesComment linesLines of code
PHP72224,33719,886123,374
PO File12221,70122,10844,770
XSD499764,991
Markdown963702,553
JavaScript8309801,041
CSS612422562
JSON900552
XML1630321
SVG10011
Qt Linguist10010
YAML4007
DOS Batch1004
INI1001

PHP code 50% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
These items need your attention
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 157)
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity5.90
▷ Minimum class complexity1.00
▷ Maximum class complexity263.00
Average method complexity2.13
▷ Minimum method complexity1.00
▷ Maximum method complexity157.00
Code structure
Namespaces118
Interfaces17
Traits0
Classes600
▷ Abstract classes101.67%
▷ Concrete classes59098.33%
▷ Final classes10.17%
Methods2,495
▷ Static methods96238.56%
▷ Public methods2,26090.58%
▷ Protected methods1325.29%
▷ Private methods1034.13%
Functions226
▷ Named functions6528.76%
▷ Anonymous functions16171.24%
Constants102
▷ Global constants54.90%
▷ Class constants9795.10%
▷ Public constants97100.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
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%