77% digital-publishing

Code Review | Digital Publishing Tools for WordPress

WordPress plugin Digital Publishing Tools for WordPress scored77%from 54 tests.

About plugin

  • Plugin page: digital-publishing
  • Plugin version: 2.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.3.1
  • WordPress version: 6.3.1
  • First release: Sep 30, 2015
  • Latest release: May 4, 2016
  • Number of updates: 23
  • Update frequency: every 11.4 days
  • Top authors: StudioMercury (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,111 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

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

A check of server-side resources used by Digital Publishing Tools for WordPress
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.74 ▲1.2849.38 ▲8.26
Dashboard /wp-admin4.60 ▲1.2557.97 ▼0.04
Posts /wp-admin/edit.php4.65 ▲1.2966.86 ▲19.13
Add New Post /wp-admin/post-new.php7.12 ▲1.2387.36 ▼18.47
Media Library /wp-admin/upload.php4.46 ▲1.2342.12 ▲4.56

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 352 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
can_compress_scripts
widget_recent-posts
db_upgraded
widget_theysaidso_widget
dpsfa_defaultTemplate
theysaidso_admin_options

Browser metrics Passed 4 tests

Digital Publishing Tools for WordPress: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲7213.33 ▼1.101.91 ▲0.0242.07 ▼1.59
Dashboard /wp-admin2,221 ▲364.80 ▼0.0997.53 ▼5.3537.95 ▼8.49
Posts /wp-admin/edit.php2,134 ▲382.05 ▲0.0343.65 ▲2.2637.97 ▲3.89
Add New Post /wp-admin/post-new.php1,546 ▲3223.37 ▲5.78665.93 ▼22.7062.72 ▲17.65
Media Library /wp-admin/upload.php1,400 ▲154.23 ▲0.0596.95 ▼10.2245.99 ▼1.58

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • dpsfa_defaultTemplate
    • can_compress_scripts
    • theysaidso_admin_options

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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 18× GET requests to PHP files return non-empty strings (only 10 are shown):
    • > /wp-content/plugins/digital-publishing/classes/cms-modules/wordpress/dpsfa-cms-wordpress-ajax.php
    • > /wp-content/plugins/digital-publishing/classes/dpsfa-bundlr.php
    • > /wp-content/plugins/digital-publishing/classes/dpsfa-templates.php
    • > /wp-content/plugins/digital-publishing/classes/dpsfa-content.php
    • > /wp-content/plugins/digital-publishing/classes/dpsfa-error-logging.php
    • > /wp-content/plugins/digital-publishing/classes/dpsfa-publication.php
    • > /wp-content/plugins/digital-publishing/classes/cms-modules/wordpress/dpsfa-cms-wordpress.php
    • > /wp-content/plugins/digital-publishing/classes/cms-modules/wordpress/dpsfa-cms-wordpress-cpt-article.php
    • > /wp-content/plugins/digital-publishing/classes/dpsfa-curl.php
    • > /wp-content/plugins/digital-publishing/classes/dpsfa-entity.php
  • 17× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Mustache_Logger_AbstractLogger' not found in wp-content/plugins/digital-publishing/libs/Mustache/Logger/StreamLogger.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function DPSFolioAuthor\\get_bloginfo() in wp-content/plugins/digital-publishing/classes/cms-modules/wordpress/dpsfa-cms-wordpress.php:37
    • > PHP Fatal error
      Uncaught Error: Interface 'Mustache_Exception' not found in wp-content/plugins/digital-publishing/libs/Mustache/Exception/UnknownHelperException.php:15
    • > PHP Warning
      Use of undefined constant DPSFA_DIR_NAME - assumed 'DPSFA_DIR_NAME' (this will throw an Error in a future version of PHP) in wp-content/plugins/digital-publishing/publish-templates/article.php on line 15
    • > PHP Fatal error
      Uncaught Error: Interface 'Mustache_Loader' not found in wp-content/plugins/digital-publishing/libs/Mustache/Loader/StringLoader.php:26
    • > PHP Fatal error
      Uncaught Error: Interface 'Mustache_Logger' not found in wp-content/plugins/digital-publishing/libs/Mustache/Logger/AbstractLogger.php:21
    • > PHP Fatal error
      Uncaught Error: Interface 'Mustache_Exception' not found in wp-content/plugins/digital-publishing/libs/Mustache/Exception/UnknownFilterException.php:15
    • > PHP Fatal error
      Uncaught Error: Interface 'Mustache_Loader' not found in wp-content/plugins/digital-publishing/libs/Mustache/Loader/InlineLoader.php:51
    • > PHP Fatal error
      Uncaught Error: Interface 'Mustache_Loader' not found in wp-content/plugins/digital-publishing/libs/Mustache/Loader/FilesystemLoader.php:27
    • > PHP Fatal error
      Uncaught Error: Interface 'Mustache_Exception' not found in wp-content/plugins/digital-publishing/libs/Mustache/Exception/InvalidArgumentException.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 93% 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
7 plugin tags: digital publishing, dps, digital publishing solution, aem mobile, adobe...

digital-publishing/digital-publishing-tools-for-wordpress.php 85% from 13 tests

The principal PHP file in "Digital Publishing Tools for WordPress" v. 2.1.0 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 153 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("digital-publishing.php" instead of "digital-publishing-tools-for-wordpress.php")

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin62,489 lines of code in 307 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript636,67626,42932,727
PHP511,4472,8379,173
CSS1228537,689
LESS711,3511,5765,906
HTML467992524,466
Markdown1539101,006
JSON4210897
SVG100288
CoffeeScript24550168
TypeScript1141894
Mustache20069
make1306

PHP code 0% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
It is recommended to fix the following
  • Cyclomatic complexity of classes should be reduced to less than 1000 (currently 1,053)
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 1,003)
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity39.74
▷ Minimum class complexity1.00
▷ Maximum class complexity1,053.00
Average method complexity5.15
▷ Minimum method complexity1.00
▷ Maximum method complexity1,003.00
Code structure
Namespaces1
Interfaces4
Traits0
Classes46
▷ Abstract classes24.35%
▷ Concrete classes4495.65%
▷ Final classes00.00%
Methods480
▷ Static methods112.29%
▷ Public methods36776.46%
▷ Protected methods265.42%
▷ Private methods8718.12%
Functions7
▷ Named functions685.71%
▷ Anonymous functions114.29%
Constants135
▷ Global constants7555.56%
▷ Class constants6044.44%
▷ Public constants60100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
10 PNG files occupy 3.34MB with 2.38MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/icon-1024x1024.png661.78KB177.75KB▼ 73.14%
assets/screenshot-3.png1,178.08KB385.58KB▼ 67.27%
assets/icon-256x256.png78.96KB21.30KB▼ 73.02%
assets/screenshot-2.png432.21KB125.07KB▼ 71.06%
assets/icon.png229.09KB63.25KB▼ 72.39%