83% novelist

Code Review | Novelist

WordPress plugin Novelist scored 83% from 54 tests.

About plugin

  • Plugin page: novelist
  • Plugin version: 1.2.2
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.3.1
  • WordPress version: 6.3.1
  • First release: Apr 13, 2016
  • Latest release: Sep 24, 2023
  • Number of updates: 53
  • Update frequency: every 51.3 days
  • Top authors: NoseGraze (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

1,000+ active / 22,516 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.23MB] [CPU: ▲2.61ms] 75% from 4 tests

Server-side resources used by Novelist
It is recommended to improve the following
  • CPU: Total CPU usage must kept under 500.00ms (currently 936.37ms on /wp-admin/edit.php?post_type=book&page=novelist-extensions)
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1846.70 ▲3.18
Dashboard /wp-admin3.54 ▲0.2353.85 ▲0.16
Posts /wp-admin/edit.php3.66 ▲0.3057.38 ▲4.10
Add New Post /wp-admin/post-new.php6.15 ▲0.26103.25 ▲2.98
Media Library /wp-admin/upload.php3.45 ▲0.2343.60 ▲4.46
Tools /wp-admin/edit.php?post_type=book&page=novelist-tools3.4641.79
Getting Started with Novelist /wp-admin/index.php?page=novelist-getting-started3.4547.88
Series /wp-admin/edit-tags.php?taxonomy=novelist-series&post_type=book3.4544.05
Genres /wp-admin/edit-tags.php?taxonomy=novelist-genre&post_type=book3.4543.60
Add New /wp-admin/post-new.php?post_type=book3.61113.96
Extensions /wp-admin/edit.php?post_type=book&page=novelist-extensions3.48936.37
Welcome to Novelist /wp-admin/index.php?page=novelist-about3.4243.30
Novelist Changelog /wp-admin/index.php?page=novelist-changelog3.4339.00
All Books /wp-admin/edit.php?post_type=book3.5556.69
Settings /wp-admin/edit.php?post_type=book&page=novelist-settings3.4755.79

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 84 new files
Database: no new tables, 11 new options
New WordPress options
widget_novelist_word_count_widget
widget_recent-comments
widget_novelist_book_widget
theysaidso_admin_options
widget_novelist_books_by_series_widget
widget_theysaidso_widget
db_upgraded
novelist_version
novelist_settings
can_compress_scripts
...

Browser metrics Passed 4 tests

An overview of browser requirements for Novelist
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,858 ▲3314.38 ▲1.051.85 ▼0.4443.31 ▼0.36
Dashboard /wp-admin2,253 ▲445.89 ▲0.03111.72 ▲12.7637.10 ▼0.23
Posts /wp-admin/edit.php2,147 ▲552.06 ▲0.0537.52 ▼14.7732.50 ▼5.29
Add New Post /wp-admin/post-new.php1,922 ▲39323.02 ▲4.83593.64 ▼59.2658.10 ▲3.44
Media Library /wp-admin/upload.php1,441 ▲564.22 ▲0.10101.11 ▼25.3240.77 ▼4.17
Tools /wp-admin/edit.php?post_type=book&page=novelist-tools1,1443.7950.3325.54
Getting Started with Novelist /wp-admin/index.php?page=novelist-getting-started1,1693.5464.49110.17
Series /wp-admin/edit-tags.php?taxonomy=novelist-series&post_type=book1,3122.1431.5732.65
Genres /wp-admin/edit-tags.php?taxonomy=novelist-genre&post_type=book1,3122.1430.4031.10
Add New /wp-admin/post-new.php?post_type=book3,05110.43236.3080.32
Extensions /wp-admin/edit.php?post_type=book&page=novelist-extensions1,1423.5056.8535.14
Welcome to Novelist /wp-admin/index.php?page=novelist-about8562.0226.3234.14
Novelist Changelog /wp-admin/index.php?page=novelist-changelog1,1552.0630.4843.67
All Books /wp-admin/edit.php?post_type=book1,3293.8465.4134.56
Settings /wp-admin/edit.php?post_type=book&page=novelist-settings1,7523.4873.5238.64

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • This plugin does not fully uninstall, leaving 11 options in the database
    • widget_novelist_book_widget
    • can_compress_scripts
    • widget_novelist_word_count_widget
    • db_upgraded
    • widget_theysaidso_widget
    • novelist_settings
    • novelist_version
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • ...

Smoke tests 75% 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 50% 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
Please take a closer look at the following
  • 22× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/novelist/templates/widgets/widget-word-count.php:44
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/novelist/templates/shortcode-book-content-button.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/novelist/includes/book-filters.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/novelist/includes/widgets/widget-word-count.php:10
    • > PHP Notice
      Undefined variable: instance in wp-content/plugins/novelist/templates/widgets/widget-word-count.php on line 32
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/novelist/includes/book-functions.php:413
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/novelist/templates/shortcode-book-content-series-number.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/novelist/includes/widgets/widget-book.php:10
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/novelist/templates/widgets/widget-book.php on line 15
    • > PHP Notice
      Undefined variable: instance in wp-content/plugins/novelist/templates/widgets/widget-book.php on line 15

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 93% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
6 plugin tags: publishing, goodreads, books, authors, writer...

novelist/novelist.php 85% from 13 tests

"Novelist" version 1.2.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Domain Path: Use only dashes and lowercase characters for the domain path ("languages")
  • Domain Path: Prefix the domain path with a forward slash character ("/languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected33,913 lines of code in 72 files:
LanguageFilesBlank linesComment linesLines of code
JSON30027,270
PHP421,4783,2085,552
Sass141083622
JavaScript9134187465
CSS4024

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity36.91
▷ Minimum class complexity9.00
▷ Maximum class complexity119.00
Average method complexity3.93
▷ Minimum method complexity1.00
▷ Maximum method complexity45.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods135
▷ Static methods10.74%
▷ Public methods13297.78%
▷ Protected methods00.00%
▷ Private methods32.22%
Functions122
▷ Named functions11997.54%
▷ Anonymous functions32.46%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 compressed PNG files occupy 0.02MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/screenshots/edit-book.png15.53KB15.32KB▼ 1.35%
assets/images/screenshots/book-template.png9.74KB8.98KB▼ 7.73%