62% books-papers

Code Review | Books & Papers

WordPress plugin Books & Papers scored 62% from 54 tests.

About plugin

  • Plugin page: books-papers
  • Plugin version: 0.20210223
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1.1-5.6
  • WordPress version: 5.8.1
  • First release: Apr 17, 2019
  • Latest release: Feb 23, 2021
  • Number of updates: 178
  • Update frequency: every 3.8 days
  • Top authors: frier (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

200+ active / 4,167 total downloads

Benchmarks

Plugin footprint 65% 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.74MB] [CPU: ▼129.02ms] Passed 4 tests

An overview of server-side resources used by Books & Papers
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.78 ▲1.0641.71 ▲21.70
Dashboard /wp-admin3.83 ▲0.7758.67 ▲14.95
Posts /wp-admin/edit.php3.88 ▲0.7749.39 ▲7.98
Add New Post /wp-admin/post-new.php6.13 ▲0.6999.05 ▼544.21
Media Library /wp-admin/upload.php3.71 ▲0.7136.30 ▲5.19

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 31 new files
Database: 13 new tables, 36 new options
New tables
wp_Books_n_Papers_Conference_Authors
wp_Books_n_Papers_Article_Authors
wp_Books_n_Papers_Conference_Tag
wp_Books_n_Papers_Book_Editor
wp_Books_n_Papers_Book_Authors
wp_Books_n_Papers_Conferences
wp_Books_n_Papers_Articles
wp_Books_n_Papers_Authors
wp_Books_n_Papers_Book_Tag
wp_Books_n_Papers_Books
...
New WordPress options
bnpp_article_head
bnpp_tables_created
bnpp_comp_perf_auth
bnpp_article_list
bnpp_book_list
bnpp_drop_db_tables
bnpp_list_division_style
bnpp_custom_char3_name
bnpp_custom_char1_name
bnpp_timeout_step
...

Browser metrics Passed 4 tests

An overview of browser requirements for Books & Papers
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,757 ▲16116.05 ▲0.449.52 ▲0.6248.79 ▲0.44
Dashboard /wp-admin3,024 ▲935.91 ▼0.26140.05 ▲3.47119.22 ▲10.90
Posts /wp-admin/edit.php2,790 ▲512.73 ▲0.0065.07 ▲0.2089.64 ▲1.17
Add New Post /wp-admin/post-new.php1,532 ▼36918.82 ▼0.38358.00 ▼27.30106.61 ▲1.74
Media Library /wp-admin/upload.php1,861 ▲545.03 ▲0.01146.22 ▲5.28120.95 ▲0.66
Manage Authors /wp-admin/bnpp_manage-authors-u.php260.900.0611.76
Books and Papers /wp-admin/bnpp_books-n-papers.php260.900.1110.04
Add Work /wp-admin/bnpp_add-paper-u.php260.900.069.25
Manage Works /wp-admin/bnpp_manage-papers-u.php260.900.1010.70
Books and Papers /wp-admin/bnpp_paper-settings-u.php260.900.059.43
Add Author /wp-admin/bnpp_add-author-u.php260.900.069.70
Import Works /wp-admin/bnpp_import-papers-u.php260.900.069.21

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Zombie tables were found after uninstall: 13 tables
    • wp_Books_n_Papers_Book_Editor
    • wp_Books_n_Papers_Article_Tag
    • wp_Books_n_Papers_Book_Tag
    • wp_Books_n_Papers_Conferences
    • wp_Books_n_Papers_Conference_Tag
    • wp_Books_n_Papers_Books
    • wp_Books_n_Papers_Book_Authors
    • wp_Books_n_Papers_Tags
    • wp_Books_n_Papers_Conference_Authors
    • wp_Books_n_Papers_Article_Authors
    • ...
  • The uninstall procedure has failed, leaving 36 options in the database
    • bnpp_list_division_style
    • bnpp_upload_dir_abs
    • bnpp_custom_char3_value
    • bnpp_comp_lbracket
    • bnpp_list_order
    • bnpp_article_head
    • bnpp_book_head
    • bnpp_custom_char2_name
    • bnpp_conference_head
    • bnpp_previous_db_prefix
    • ...

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
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
Please take a closer look at the following
  • 4× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/books-papers/pages/title-page.php
    • > /wp-content/plugins/books-papers/pages/loadAnimation.php
    • > /wp-content/plugins/books-papers/pages/add-author-page.php
    • > /wp-content/plugins/books-papers/pages/import-data-page.php
  • 71× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Warning
      include(): Failed opening 'bnpp_plugin_dir./pages/loadAnimation.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/books-papers/pages/settings-page.php on line 1
    • > PHP Warning
      include(bnpp_plugin_dir./pages/style.css): failed to open stream: No such file or directory in wp-content/plugins/books-papers/pages/import-data-page.php on line 3
    • > PHP Warning
      include(bnpp_plugin_dir./pages/style.css): failed to open stream: No such file or directory in wp-content/plugins/books-papers/pages/settings-page.php on line 3
    • > PHP Warning
      include(): Failed opening 'bnpp_plugin_dir./pages/loadAnimation.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/books-papers/pages/add-author-page.php on line 1
    • > PHP Warning
      Use of undefined constant bnpp_plugin_dir - assumed 'bnpp_plugin_dir' (this will throw an Error in a future version of PHP) in wp-content/plugins/books-papers/pages/add-paper-page.php on line 1
    • > PHP Warning
      include(bnpp_plugin_dir./pages/loadAnimation.php): failed to open stream: No such file or directory in wp-content/plugins/books-papers/pages/import-data-page.php on line 1
    • > PHP Warning
      Use of undefined constant bnpp_plugin_dir - assumed 'bnpp_plugin_dir' (this will throw an Error in a future version of PHP) in wp-content/plugins/books-papers/pages/manage-author-page.php on line 1
    • > PHP Warning
      include(bnpp_plugin_dir./pages/loadAnimation.php): failed to open stream: No such file or directory in wp-content/plugins/books-papers/pages/add-paper-page.php on line 1
    • > PHP Warning
      include(): Failed opening 'bnpp_plugin_dir./pages/style.css' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/books-papers/pages/manage-papers-page.php on line 4
    • > PHP Warning
      include(bnpp_plugin_dir./pages/loadAnimation.php): failed to open stream: No such file or directory in wp-content/plugins/books-papers/pages/manage-author-page.php on line 1

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please fix the following browser errors
    • > GET request to /wp-admin/bnpp_manage-authors-u.php
    • > Network (severe)
    wp-admin/bnpp_manage-authors-u.php - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/bnpp_books-n-papers.php
    • > Network (severe)
    wp-admin/bnpp_books-n-papers.php - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/bnpp_add-paper-u.php
    • > Network (severe)
    wp-admin/bnpp_add-paper-u.php - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/bnpp_manage-papers-u.php
    • > Network (severe)
    wp-admin/bnpp_manage-papers-u.php - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/bnpp_paper-settings-u.php
    • > Network (severe)
    wp-admin/bnpp_paper-settings-u.php - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/bnpp_add-author-u.php
    • > Network (severe)
    wp-admin/bnpp_add-author-u.php - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/bnpp_import-papers-u.php
    • > Network (severe)
    wp-admin/bnpp_import-papers-u.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 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
These attributes need to be fixed:
  • Donate link: Please fix this invalid url: ""
Please take inspiration from this readme.txt

books-papers/books-n-papers.php 92% from 13 tests

The main file in "Books & Papers" v. 0.20210223 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("books-papers.php" instead of "books-n-papers.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin8,226 lines of code in 27 files:
LanguageFilesBlank linesComment linesLines of code
PHP17771046,832
JavaScript82421,262
CSS100103
Markdown18029

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
Please tend to the following items
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 135)
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity119.57
▷ Minimum class complexity1.00
▷ Maximum class complexity576.00
Average method complexity12.86
▷ Minimum method complexity1.00
▷ Maximum method complexity135.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes114.29%
▷ Concrete classes685.71%
▷ Final classes00.00%
Methods70
▷ Static methods45.71%
▷ Public methods5477.14%
▷ Protected methods00.00%
▷ Private methods1622.86%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin