10% writer-helper

Code Review | Writer Helper

WordPress plugin Writer Helper scored10%from 54 tests.

About plugin

  • Plugin page: writer-helper
  • Plugin version: 3.1.6
  • PHP compatiblity: 7.0.30+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.8
  • WordPress version: 6.3.1
  • First release: May 14, 2019
  • Latest release: Oct 11, 2022
  • Number of updates: 90
  • Update frequency: every 13.8 days
  • Top authors: clarissekm (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /2,250 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
These installer errors require your attention
  • Install procedure validation failed for this plugin
    • > Notice in wp-content/plugins/writer-helper/includes/functions/db_functions.php+200
    Trying to access array offset on value of type null

Server metrics [RAM: ▲2.13MB] [CPU: ▲7.85ms] Passed 4 tests

Server-side resources used by Writer Helper
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /5.65 ▲2.1953.26 ▲16.85
Dashboard /wp-admin5.47 ▲2.1371.70 ▲8.06
Posts /wp-admin/edit.php5.53 ▲2.1763.57 ▲10.50
Add New Post /wp-admin/post-new.php8.00 ▲2.11103.11 ▼4.03
Media Library /wp-admin/upload.php5.34 ▲2.1153.54 ▲21.32
My Books /wp-admin/admin.php?page=wtrh_books5.3479.37
Statistics /wp-admin/admin.php?page=wtrh_stats5.3250.77
Users /wp-admin/admin.php?page=wtrh_users5.3450.20
Communities /wp-admin/admin.php?page=wtrh_communities5.3352.87
Bookworlds /wp-admin/admin.php?page=wtrh_bookworlds5.3251.08
My To Do List /wp-admin/admin.php?page=wtrh_todolist5.3245.58
Settings /wp-admin/admin.php?page=wtrh_settings5.4150.47
Starting with WH /wp-admin/admin.php?page=wtr_helper5.3350.90

Server storage [IO: ▲4.62MB] [DB: ▲0.02MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 129 new files
Database: 7 new tables, 13 new options
New tables
wp_wtr_scene
wp_wtr_activity
wp_wtr_users
wp_wtr_category
wp_wtr_metadata
wp_wtr_chapter
wp_wtr_book
New WordPress options
widget_theysaidso_widget
widget_wh_book_info
widget_wh_search_book
widget_wh_chapter_book_summary
widget_wh_library
theysaidso_admin_options
widget_recent-comments
widget_wh_lastestpubli
widget_wh_chapter_book_info
db_upgraded
...

Browser metrics Passed 4 tests

A check of browser resources used by Writer Helper
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,916 ▲15514.37 ▼0.381.66 ▲0.0639.01 ▼5.26
Dashboard /wp-admin2,314 ▲1375.56 ▼0.1184.91 ▼8.5340.77 ▼2.95
Posts /wp-admin/edit.php2,151 ▲481.96 ▼0.0636.12 ▼7.7532.86 ▼3.31
Add New Post /wp-admin/post-new.php1,566 ▲4023.69 ▲0.45616.17 ▼39.3459.33 ▲6.06
Media Library /wp-admin/upload.php1,454 ▲544.22 ▲0.05102.08 ▼5.1645.81 ▼0.69
My Books /wp-admin/admin.php?page=wtrh_books9792.4031.2631.56
Statistics /wp-admin/admin.php?page=wtrh_stats8912.3529.8621.95
Users /wp-admin/admin.php?page=wtrh_users9222.3627.7735.38
Communities /wp-admin/admin.php?page=wtrh_communities9222.3528.0226.25
Bookworlds /wp-admin/admin.php?page=wtrh_bookworlds8932.3528.1324.31
My To Do List /wp-admin/admin.php?page=wtrh_todolist8512.3530.1121.91
Settings /wp-admin/admin.php?page=wtrh_settings1,1612.3731.8835.49
Starting with WH /wp-admin/admin.php?page=wtr_helper9762.3628.5325.68

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
The following items require your attention
  • Zombie WordPress options were found after uninstall: 13 options
    • db_upgraded
    • widget_wh_library
    • widget_wh_lastestpubli
    • widget_wh_book_summary
    • widget_wh_search_book
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_wh_chapter_book_summary
    • widget_wh_book_info
    • ...

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Please fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wtrh_bookworlds
    • > request to
    • > Notice in wp-config.php+20
    Undefined index: REQUEST_METHOD

SRP 0% 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
Almost there! Just fix the following items
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/writer-helper/js/wtrh_d3_scenes_2.js.php
    • > /wp-content/plugins/writer-helper/js/wtrh_d3_scenes.js.php
  • 413× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/writer-helper/includes/pages/page_users_tab4.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'WH_BookSettings' not found in wp-content/plugins/writer-helper/includes/pages/page_settings_tab2.php:5
    • > PHP Warning
      Use of undefined constant WTRH_COMMUNITIES_DIR - assumed 'WTRH_COMMUNITIES_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/writer-helper/includes/pages/page_communities_tab3.php on line 3
    • > PHP Warning
      include_once(): Failed opening 'WTRH_INCLUDE_DIR/functions/buttons_functions.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/writer-helper/includes/pages/page_book.php on line 4
    • > PHP Warning
      Use of undefined constant WTRH_EPUBGENERATOR_DIR - assumed 'WTRH_EPUBGENERATOR_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/writer-helper/includes/classes/class_book.php on line 6
    • > PHP Warning
      Use of undefined constant EPUB_INCLUDE_DIR - assumed 'EPUB_INCLUDE_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/writer-helper/epubgenerator/include/epub_xhtmlnav.class.php on line 5
    • > PHP Warning
      Use of undefined constant WTRH_INCLUDE_DIR - assumed 'WTRH_INCLUDE_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/writer-helper/includes/classes/class_main.php on line 5
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/writer-helper/js/wtrh_d3_scenes_2.js.php on line 15
    • > PHP Warning
      Use of undefined constant WTRH_INCLUDE_DIR - assumed 'WTRH_INCLUDE_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/writer-helper/includes/writer-helper-class.php on line 22
    • > PHP Warning
      include_once(): Failed opening 'EPUB_INCLUDE_DIR/epub_xhtmlnav.class.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/writer-helper/epubgenerator/include/epub_generator.class.php on line 12

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 93% 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 require attention:
  • Tags: Please delete some tags, you are using 12 tag instead of maximum 10
The official readme.txt is a good inspiration

writer-helper/writer-helper.php 92% from 13 tests

The entry point to "Writer Helper" version 3.1.6 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Text Domain: The text domain should only use lowercase characters and dashes

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected70,190 lines of code in 116 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript1611,15618,00949,082
PHP832,9632,04214,041
Markdown490002,970
PO File21,2431,9842,662
CSS111761621,435

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity36.25
▷ Minimum class complexity1.00
▷ Maximum class complexity215.00
Average method complexity3.83
▷ Minimum method complexity1.00
▷ Maximum method complexity43.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes36
▷ Abstract classes25.56%
▷ Concrete classes3494.44%
▷ Final classes00.00%
Methods455
▷ Static methods11124.40%
▷ Public methods38384.18%
▷ Protected methods10.22%
▷ Private methods7115.60%
Functions89
▷ Named functions89100.00%
▷ Anonymous functions00.00%
Constants205
▷ Global constants3818.54%
▷ Class constants16781.46%
▷ Public constants167100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
3 PNG files occupy 0.08MB with 0.05MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/WriterHelper_icon.png68.74KB27.41KB▼ 60.13%
img/NoCover.png3.98KB1.88KB▼ 52.87%
img/NoCover2.png13.70KB5.46KB▼ 60.19%