78% gedshow

Code Review | GedShow

WordPress plugin GedShow scored78%from 54 tests.

About plugin

  • Plugin page: gedshow
  • Plugin version: 2.1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.3
  • WordPress version: 6.3.1
  • First release: Jan 8, 2019
  • Latest release: Jul 22, 2023
  • Number of updates: 65
  • Update frequency: every 25.5 days
  • Top authors: colinsp (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

200+ active /5,557 total downloads

Benchmarks

Plugin footprint 83% 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: ▲4.84ms] Passed 4 tests

Analyzing server-side resources used by GedShow
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.21 ▲0.7444.56 ▲7.33
Dashboard /wp-admin4.06 ▲0.7555.74 ▲10.13
Posts /wp-admin/edit.php4.11 ▲0.7553.84 ▲5.55
Add New Post /wp-admin/post-new.php6.57 ▲0.6888.26 ▲1.15
Media Library /wp-admin/upload.php3.89 ▲0.6638.87 ▲5.32
Options /wp-admin/admin.php?page=gedshow_options3.8938.42
GedShow /wp-admin/admin.php?page=gedshow3.8938.86
Photos /wp-admin/admin.php?page=gedshow_photos3.8938.59
Pages /wp-admin/admin.php?page=gedshow_pages3.9639.71

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 31 new files
Database: no new tables, 10 new options
New WordPress options
theysaidso_admin_options
widget_gedshow_anniversary_widget
db_upgraded
widget_gedshow_surnames_widget
widget_gedshow_in_memoriam_widget
widget_gedshow_birthday_widget
can_compress_scripts
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by GedShow
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,995 ▲22414.89 ▲0.241.65 ▼0.3443.66 ▼3.95
Dashboard /wp-admin2,397 ▲2066.63 ▲1.74134.45 ▲26.9241.72 ▼3.62
Posts /wp-admin/edit.php2,306 ▲2173.55 ▲1.5151.14 ▲13.4732.07 ▼2.72
Add New Post /wp-admin/post-new.php1,556 ▲3617.69 ▼5.72631.85 ▼63.1234.16 ▼23.43
Media Library /wp-admin/upload.php1,445 ▲574.41 ▲0.2682.03 ▼25.6344.39 ▼1.94
Options /wp-admin/admin.php?page=gedshow_options1,1783.7750.4226.36
GedShow /wp-admin/admin.php?page=gedshow1,0743.3439.7830.12
Photos /wp-admin/admin.php?page=gedshow_photos1,0443.2740.7769.39
Pages /wp-admin/admin.php?page=gedshow_pages1,0413.2841.6468.04

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
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 10 options
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_gedshow_anniversary_widget
    • db_upgraded
    • widget_gedshow_birthday_widget
    • widget_gedshow_surnames_widget
    • widget_recent-posts
    • widget_gedshow_in_memoriam_widget
    • 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
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
The following issues need your attention
  • 52× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Warning
      include_once(GS_PLUGIN_DIR/classes/gs_Fact.class.php): failed to open stream: No such file or directory in wp-content/plugins/gedshow/includes/gedshow_get_ind_function.php on line 4
    • > PHP Warning
      include_once(): Failed opening 'GS_PLUGIN_DIR/includes/gedshow_db_handler.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/gedshow/gedshow_allnames_shortcode.php on line 11
    • > PHP Warning
      Use of undefined constant GS_PLUGIN_DIR - assumed 'GS_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/gedshow/gedshow_page_shortcode.php on line 11
    • > PHP Warning
      include_once(): Failed opening 'GS_PLUGIN_DIR/includes/gedshow_udf.inc.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/gedshow/gedshow_page_shortcode.php on line 12
    • > PHP Warning
      Use of undefined constant GS_PLUGIN_DIR - assumed 'GS_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/gedshow/includes/gedshow_get_ind_function.php on line 3
    • > PHP Warning
      include_once(GS_PLUGIN_DIR/includes/gedshow_get_name_details.php): failed to open stream: No such file or directory in wp-content/plugins/gedshow/gedshow_allnames_shortcode.php on line 8
    • > PHP Warning
      include_once(GS_PLUGIN_DIR/includes/gedshow_udf.inc.php): failed to open stream: No such file or directory in wp-content/plugins/gedshow/gedshow_page_shortcode.php on line 12
    • > PHP Warning
      include_once(): Failed opening 'GS_PLUGIN_DIR/classes/gs_Person.class.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/gedshow/includes/gedshow_get_ind_function.php on line 3
    • > PHP Warning
      include_once(GS_PLUGIN_DIR/includes/gedshow_udf.inc.php): failed to open stream: No such file or directory in wp-content/plugins/gedshow/gedshow_allnames_shortcode.php on line 12
    • > PHP Warning
      include_once(GS_PLUGIN_DIR/includes/gedshow_get_ind_function.php): failed to open stream: No such file or directory in wp-content/plugins/gedshow/gedshow_allnames_shortcode.php on line 10

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There are user-side issues you should fix
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=gedshow_pages
    • > Network (severe)
    wp-content/plugins/gedshow/my-script.js?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
10 plugin tags: gedcom, genealogy, ancestry, ancestor, heritage...

gedshow/csgen.php 92% from 13 tests

The main PHP file in "GedShow" ver. 2.1.0 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("gedshow.php" instead of "csgen.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected4,105 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
PHP225041,0343,972
CSS166133

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity23.75
▷ Minimum class complexity1.00
▷ Maximum class complexity66.00
Average method complexity3.09
▷ Minimum method complexity1.00
▷ Maximum method complexity59.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods87
▷ Static methods00.00%
▷ Public methods8091.95%
▷ Protected methods00.00%
▷ Private methods78.05%
Functions79
▷ Named functions79100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.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
5 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/image-lg.png13.91KB11.27KB▼ 18.97%
images/image.png2.25KB1.23KB▼ 45.33%
images/note.png1.96KB0.51KB▼ 73.73%
images/note-lg.png0.80KB0.59KB▼ 25.67%
images/page.png0.26KB0.17KB▼ 33.96%