68% wp-book

Code Review | WP Book

WordPress plugin WP Book scored68%from 54 tests.

About plugin

  • Plugin page: wp-book
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.9.8
  • WordPress version: 6.3.1
  • First release: Oct 27, 2018
  • Latest release: Oct 27, 2018
  • Number of updates: 4
  • Update frequency: every 21.0 days
  • Top authors: rajanit2000 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /937 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▼0.95MB] [CPU: ▼35.76ms] Passed 4 tests

Server-side resources used by WP Book
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0238.17 ▼5.02
Dashboard /wp-admin3.00 ▼0.3422.45 ▼35.78
Posts /wp-admin/edit.php3.00 ▼0.3522.83 ▼21.99
Add New Post /wp-admin/post-new.php3.00 ▼2.8820.18 ▼74.20
Media Library /wp-admin/upload.php3.00 ▼0.2221.94 ▼11.08
WP Book /wp-admin/options-general.php?page=wp-book3.0124.21

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 789 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP Book
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,799 ▲5313.27 ▼1.011.78 ▲0.0743.45 ▲3.55
Dashboard /wp-admin2,202 ▲255.89 ▲0.20107.31 ▲20.2242.21 ▼0.88
Posts /wp-admin/edit.php2,117 ▲172.42 ▲0.4137.50 ▼0.2729.09 ▼3.91
Add New Post /wp-admin/post-new.php6,256 ▲4,73021.86 ▼1.30962.83 ▲285.6938.34 ▼17.84
Media Library /wp-admin/upload.php1,410 ▲134.42 ▲0.14110.90 ▲13.1644.03 ▲2.13
WP Book /wp-admin/options-general.php?page=wp-book1,7772.5148.1032.58

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin cannot be uninstalled
    • > User notice in wp-includes/functions.php+5905
    Function add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be numeric representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded

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
    • > GET request to /wp-admin/options-general.php?page=wp-book
    • > User notice in wp-includes/functions.php+5905
    Function add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be numeric representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)

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
  • 159× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\Tag' not found in wp-content/plugins/wp-book/vendor/mpdf/mpdf/src/Tag/DotTab.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\Tag' not found in wp-content/plugins/wp-book/vendor/mpdf/mpdf/src/Tag/NewColumn.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'DeepCopy\\Matcher\\Matcher' not found in wp-content/plugins/wp-book/vendor/myclabs/deep-copy/src/DeepCopy/Matcher/Doctrine/DoctrineProxyMatcher.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\InlineTag' not found in wp-content/plugins/wp-book/vendor/mpdf/mpdf/src/Tag/Meter.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\BlockTag' not found in wp-content/plugins/wp-book/vendor/mpdf/mpdf/src/Tag/Div.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\BlockTag' not found in wp-content/plugins/wp-book/vendor/mpdf/mpdf/src/Tag/Article.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'DeepCopy\\Filter\\Filter' not found in wp-content/plugins/wp-book/vendor/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineProxyFilter.php:10
    • > PHP Notice
      Undefined index: filename in wp-content/plugins/wp-book/vendor/mpdf/mpdf/data/out.php on line 5
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/wp-book/vendor/psr/log/Psr/Log/Test/LoggerInterfaceTest.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\Tag' not found in wp-content/plugins/wp-book/vendor/mpdf/mpdf/src/Tag/Annotation.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
5 plugin tags: mpdf, download, post, pages, pdf

wp-book/wp-book.php Passed 13 tests

The main file in "WP Book" v. 1.0.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
20 characters long description:
PDF Download plugin.

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected78,448 lines of code in 364 files:
LanguageFilesBlank linesComment linesLines of code
PHP3349,0949,39175,967
Markdown839101,134
JSON6320713
CSS66536424
XML413181
JavaScript210563
YAML321263
Bourne Shell1203

PHP code 0% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
Please tend to the following items
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 7,628)
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 460)
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity70.07
▷ Minimum class complexity1.00
▷ Maximum class complexity7,628.00
Average method complexity15.85
▷ Minimum method complexity1.00
▷ Maximum method complexity460.00
Code structure
Namespaces46
Interfaces8
Traits2
Classes237
▷ Abstract classes72.95%
▷ Concrete classes23097.05%
▷ Final classes00.00%
Methods1,167
▷ Static methods857.28%
▷ Public methods1,01787.15%
▷ Protected methods100.86%
▷ Private methods14012.00%
Functions21
▷ Named functions942.86%
▷ Anonymous functions1257.14%
Constants391
▷ Global constants51.28%
▷ Class constants38698.72%
▷ Public constants386100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
4 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/myclabs/deep-copy/doc/clone.png12.09KB5.48KB▼ 54.70%
vendor/myclabs/deep-copy/doc/deep-copy.png10.64KB5.23KB▼ 50.84%
vendor/myclabs/deep-copy/doc/graph.png6.29KB3.03KB▼ 51.86%
vendor/myclabs/deep-copy/doc/deep-clone.png13.68KB6.54KB▼ 52.22%