68% mpl-publisher

Code Review | MPL-Publisher — Ebook & Audiobook Creator

WordPress plugin MPL-Publisher — Ebook & Audiobook Creator scored68%from 54 tests.

About plugin

  • Plugin page: mpl-publisher
  • Plugin version: 2.10.0
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4
  • WordPress version: 6.3.1
  • First release: May 12, 2015
  • Latest release: Nov 24, 2023
  • Number of updates: 169
  • Update frequency: every 18.5 days
  • Top authors: ferranfg (100%)

Code review

54 tests

User reviews

18 reviews

Install metrics

400+ active /23,930 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.44MB] [CPU: ▼1.77ms] Passed 4 tests

A check of server-side resources used by MPL-Publisher — Ebook & Audiobook Creator
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.92 ▲0.4539.73 ▼2.31
Dashboard /wp-admin3.79 ▲0.4459.60 ▼7.34
Posts /wp-admin/edit.php3.83 ▲0.4760.60 ▲13.12
Add New Post /wp-admin/post-new.php6.38 ▲0.4989.02 ▼5.68
Media Library /wp-admin/upload.php3.62 ▲0.3942.21 ▲8.25
Publish eBook /wp-admin/admin.php?page=publisher4.0852.41
Resources /wp-admin/admin.php?page=mpl-extensions3.6741.71
Cover Editor /wp-admin/admin.php?page=mpl-cover3.6742.32

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 870 new files
Database: no new tables, 8 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
mpl_publisher_status
widget_recent-comments
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_mpl_publisher

Browser metrics Passed 4 tests

An overview of browser requirements for MPL-Publisher — Ebook & Audiobook Creator
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,002 ▲25517.65 ▲3.221.72 ▼0.0537.92 ▼6.72
Dashboard /wp-admin2,399 ▲2198.37 ▲2.72157.44 ▲59.5346.85 ▲1.44
Posts /wp-admin/edit.php2,341 ▲2415.77 ▲3.8368.71 ▲29.5235.40 ▲0.35
Add New Post /wp-admin/post-new.php1,595 ▲6924.59 ▲1.15665.04 ▲70.7437.34 ▼11.73
Media Library /wp-admin/upload.php1,481 ▲846.07 ▲1.9692.76 ▼5.5040.49 ▼2.17
Publish eBook /wp-admin/admin.php?page=publisher2,9085.68102.09158.95
Resources /wp-admin/admin.php?page=mpl-extensions1,4396.0166.16123.58
Cover Editor /wp-admin/admin.php?page=mpl-cover4,9915.9397.7637.72

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • widget_mpl_publisher

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 14× PHP files output non-empty strings when accessed directly via GET requests (only 10 are shown):
    • > /wp-content/plugins/mpl-publisher/vendor/wallabag/phpepub/legacy/EPub.Test.Example.php
    • > /wp-content/plugins/mpl-publisher/vendor/phpzip/phpzip/legacy/ZipStream.Example1s.php
    • > /wp-content/plugins/mpl-publisher/views/logo.php
    • > /wp-content/plugins/mpl-publisher/vendor/phpzip/phpzip/legacy/ZipStream.Example2b.php
    • > /wp-content/plugins/mpl-publisher/vendor/phpzip/phpzip/legacy/Zip.ErrorCatch1.php
    • > /wp-content/plugins/mpl-publisher/vendor/phpzip/phpzip/legacy/ZipStream.Example1.php
    • > /wp-content/plugins/mpl-publisher/vendor/masterminds/html5/bin/entities.php
    • > /wp-content/plugins/mpl-publisher/vendor/grandt/binstring/BinString.Example2.php
    • > /wp-content/plugins/mpl-publisher/vendor/phpzip/phpzip/legacy/ZipStream.Example2.php
    • > /wp-content/plugins/mpl-publisher/vendor/phpzip/phpzip/legacy/Zip.Example1.php
  • 494× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PhpOffice\\PhpWord\\Style\\Image' not found in wp-content/plugins/mpl-publisher/vendor/phpoffice/phpword/src/PhpWord/Style/Line.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'MPL\\Publisher\\PremiumPublisher' not found in wp-content/plugins/mpl-publisher/libs/AudiobookPublisher.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Intervention\\Image\\Commands\\AbstractCommand' not found in wp-content/plugins/mpl-publisher/vendor/intervention/image/src/Intervention/Image/Commands/ResponseCommand.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PHPePub\\Core\\Structure\CX\\AbstractNavEntry' not found in wp-content/plugins/mpl-publisher/vendor/wallabag/phpepub/src/PHPePub/Core/Structure/NCX/NavPoint.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'PhpOffice\\PhpWord\\Writer\\ODText\\Style\\AbstractStyle' not found in wp-content/plugins/mpl-publisher/vendor/phpoffice/phpword/src/PhpWord/Writer/ODText/Style/Font.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'Intervention\\Image\\Commands\\AbstractCommand' not found in wp-content/plugins/mpl-publisher/vendor/intervention/image/src/Intervention/Image/Gd/Commands/ContrastCommand.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PhpOffice\\PhpWord\\Writer\\ODText\\Element\\AbstractElement' not found in wp-content/plugins/mpl-publisher/vendor/phpoffice/phpword/src/PhpWord/Writer/ODText/Element/Table.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'PhpOffice\\PhpWord\\Collection\\AbstractCollection' not found in wp-content/plugins/mpl-publisher/vendor/phpoffice/phpword/src/PhpWord/Collection/Titles.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'PHPZip\\Zip\\Core\\AbstractException' not found in wp-content/plugins/mpl-publisher/vendor/phpzip/phpzip/src/Zip/Exception/BufferNotEmpty.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Intervention\\Image\\Commands\\AbstractCommand' not found in wp-content/plugins/mpl-publisher/vendor/intervention/image/src/Intervention/Image/Commands/TextCommand.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
5 plugin tags: docx, ebook, kindle, epub, audiobook

mpl-publisher/mpl-publisher.php 92% from 13 tests

The entry point to "MPL-Publisher — Ebook & Audiobook Creator" version 2.10.0 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis 3% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
These items require your attention
  • You should never include executable (binary) or otherwise dangerous files in your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/mpl-publisher/vendor/wallabag/phpepub/legacy/install.bat
65,682 lines of code in 779 files:
LanguageFilesBlank linesComment linesLines of code
PHP66511,87435,82854,711
Markdown361,27303,411
JSON24002,214
HTML3141611,658
PO File35387461,564
CSS1114817809
JavaScript11205109663
YAML146225397
XML979206
Bourne Shell2121546
DOS Batch1003

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Please tend to the following items
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 130)
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity11.09
▷ Minimum class complexity1.00
▷ Maximum class complexity299.00
Average method complexity2.75
▷ Minimum method complexity1.00
▷ Maximum method complexity130.00
Code structure
Namespaces84
Interfaces25
Traits2
Classes595
▷ Abstract classes437.23%
▷ Concrete classes55292.77%
▷ Final classes295.25%
Methods3,768
▷ Static methods46912.45%
▷ Public methods3,07281.53%
▷ Protected methods3078.15%
▷ Private methods38910.32%
Functions118
▷ Named functions6655.93%
▷ Anonymous functions5244.07%
Constants941
▷ Global constants434.57%
▷ Class constants89895.43%
▷ Public constants89699.78%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
15 PNG files occupy 0.88MB with 0.14MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/imgs/cover-placeholder.png2.27KB2.18KB▼ 3.75%
assets/css/chosen-sprite@2x.png0.72KB0.83KB0.00%
assets/imgs/theme-crimson.png310.69KB229.89KB▼ 26.01%
vendor/phpoffice/phpword/src/PhpWord/resources/ppt.png1.84KB1.79KB▼ 2.97%
assets/imgs/amazon-apps-store-us-black.png5.19KB2.73KB▼ 47.37%