62% gnupress

Code Review | GNUPress

WordPress plugin GNUPress scored62%from 54 tests.

About plugin

  • Plugin page: gnupress
  • Plugin version: 0.2.9
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.5.2
  • WordPress version: 6.3.1
  • First release: Jun 29, 2015
  • Latest release: Jul 4, 2016
  • Number of updates: 61
  • Update frequency: every 6.3 days
  • Top authors: kagla (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

100+ active /7,695 total downloads

Benchmarks

Plugin footprint 65% 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 gracefully, with no errors

Server metrics [RAM: ▲0.71MB] [CPU: ▼2.26ms] Passed 4 tests

A check of server-side resources used by GNUPress
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.00 ▲0.5457.44 ▲15.60
Dashboard /wp-admin4.13 ▲0.7852.58 ▼11.88
Posts /wp-admin/edit.php4.14 ▲0.7859.59 ▲8.16
Add New Post /wp-admin/post-new.php6.61 ▲0.7299.47 ▼9.84
Media Library /wp-admin/upload.php4.13 ▲0.9042.82 ▲4.52
Manage board /wp-admin/admin.php?page=g5_board_list4.1340.53
Manage board tag /wp-admin/admin.php?page=g5_tag_form4.1336.94
Manage user points /wp-admin/admin.php?page=g5_point_list4.1340.78
Add board /wp-admin/admin.php?page=g5_board_form4.3239.13
gnupress setting /wp-admin/admin.php?page=g5_board_admin4.1338.26

Server storage [IO: ▲2.82MB] [DB: ▲0.01MB] Passed 3 tests

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 358 new files
Database: 9 new tables, 7 new options
New tables
wp_g5_scrap
wp_g5_board
wp_g5_write
wp_g5_write_comment
wp_g5_board_good
wp_g5_term_relationships
wp_g5_point
wp_g5_writemeta
wp_g5_term_taxonomy
New WordPress options
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
g5_options
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for GNUPress
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,851 ▲9014.35 ▲0.172.37 ▲0.3543.48 ▼10.69
Dashboard /wp-admin2,244 ▲675.67 ▲0.1197.27 ▲5.0141.68 ▲0.61
Posts /wp-admin/edit.php2,152 ▲522.01 ▲0.0142.95 ▲5.8138.04 ▲2.58
Add New Post /wp-admin/post-new.php1,567 ▲3223.30 ▲4.87661.82 ▼22.0053.30 ▼29.59
Media Library /wp-admin/upload.php1,449 ▲494.19 ▲0.0395.94 ▼8.9545.23 ▲1.10
Manage board /wp-admin/admin.php?page=g5_board_list1,1542.3942.7364.34
Manage board tag /wp-admin/admin.php?page=g5_tag_form280.420.063.80
Manage user points /wp-admin/admin.php?page=g5_point_list1,1061.6925.3542.20
Add board /wp-admin/admin.php?page=g5_board_form3,4262.3944.9752.22
gnupress setting /wp-admin/admin.php?page=g5_board_admin1,7431.7425.0870.37

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • The uninstall procedure failed, leaving 9 tables in the database
    • wp_g5_board
    • wp_g5_term_relationships
    • wp_g5_board_good
    • wp_g5_writemeta
    • wp_g5_scrap
    • wp_g5_term_taxonomy
    • wp_g5_write
    • wp_g5_write_comment
    • wp_g5_point
  • The uninstall procedure has failed, leaving 7 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • g5_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These errors were triggered by the plugin
    • > GET request to /wp-admin/admin.php?page=g5_board_list
    • > Notice in wp-content/plugins/gnupress/view/board_list.php+198
    Undefined variable: form_action_url
    • > GET request to /wp-admin/admin.php?page=g5_board_form
    • > Notice in wp-content/plugins/gnupress/view/board_form.php+540
    Undefined index: bo_sh_fields

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 23× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'HTMLPurifier_Filter' not found in wp-content/plugins/gnupress/plugin/htmlpurifier/standalone/HTMLPurifier/Filter/YouTube.php:3
    • > PHP Warning
      include_once(G5_DIR_PATHlib/g5_taxonomy.lib.php): failed to open stream: No such file or directory in wp-content/plugins/gnupress/adm/admin.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'HTMLPurifier_Filter' not found in wp-content/plugins/gnupress/plugin/htmlpurifier/standalone/HTMLPurifier/Filter/ExtractStyleBlocks.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'G5_common' not found in wp-content/plugins/gnupress/lib/g5_scrap.class.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'G5_common' not found in wp-content/plugins/gnupress/lib/g5_board.class.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Walker' not found in wp-content/plugins/gnupress/lib/g5_walker.class.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'HTMLPurifier_Language' not found in wp-content/plugins/gnupress/plugin/htmlpurifier/standalone/HTMLPurifier/Language/classes/en-x-test.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'HTMLPurifier_Printer' not found in wp-content/plugins/gnupress/plugin/htmlpurifier/standalone/HTMLPurifier/Printer/ConfigForm.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'HTMLPurifier_Lexer_DOMLex' not found in wp-content/plugins/gnupress/plugin/htmlpurifier/standalone/HTMLPurifier/Lexer/PH5P.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'G5_Board' not found in wp-content/plugins/gnupress/lib/g5_board_delete.class.php:4

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
These are user-side errors you should fix
    • > GET request to /wp-admin/admin.php?page=g5_tag_form
    • > Network (severe)
    wp-admin/admin.php?page=g5_tag_form - Failed to load resource: the server responded with a status of 500 (Internal Server Error)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots require images: #1 (This is the first screen shot), #2 (This is the second screen shot)
Please take inspiration from this readme.txt

gnupress/gnupress.php 92% from 13 tests

The main PHP file in "GNUPress" ver. 0.2.9 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin37,970 lines of code in 130 files:
LanguageFilesBlank linesComment linesLines of code
PHP1087,1328,75926,452
CSS102151197,457
PO File21,3061,7243,175
JavaScript9156162885
INI1111

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
The following items need your attention
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 232)
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity14.61
▷ Minimum class complexity1.00
▷ Maximum class complexity539.00
Average method complexity5.07
▷ Minimum method complexity1.00
▷ Maximum method complexity232.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes240
▷ Abstract classes125.00%
▷ Concrete classes22895.00%
▷ Final classes00.00%
Methods817
▷ Static methods435.26%
▷ Public methods64178.46%
▷ Protected methods9011.02%
▷ Private methods8610.53%
Functions182
▷ Named functions182100.00%
▷ Anonymous functions00.00%
Constants90
▷ Global constants3235.56%
▷ Class constants5864.44%
▷ Public constants58100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
22 PNG files occupy 0.15MB with 0.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
plugin/kcaptcha/fonts/warnock.png7.48KB4.31KB▼ 42.31%
plugin/kcaptcha/fonts/constantia.png6.12KB3.51KB▼ 42.55%
plugin/kcaptcha/fonts/minion.png6.83KB3.85KB▼ 43.70%
plugin/kcaptcha/fonts/cambria.png6.34KB3.61KB▼ 43.08%
plugin/kcaptcha/fonts/perpetua.png6.68KB3.89KB▼ 41.75%