67% genealogical-tree

Code Review | Genealogical Tree - WordPress Family Tree

WordPress plugin Genealogical Tree - WordPress Family Tree scored67%from 54 tests.

About plugin

  • Plugin page: genealogical-tree
  • Plugin version: 2.2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.4
  • WordPress version: 6.3.1
  • First release: Aug 3, 2019
  • Latest release: Nov 13, 2023
  • Number of updates: 124
  • Update frequency: every 12.6 days
  • Top authors: akdevs (100%)

Code review

54 tests

User reviews

13 reviews

Install metrics

600+ active /17,760 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲5.56MB] [CPU: ▲32.19ms] 75% from 4 tests

A check of server-side resources used by Genealogical Tree - WordPress Family Tree
Please have a look at the following items
  • Extra RAM: The extra memory usage must be under 5MB (currently 5.56MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /9.07 ▲5.6070.43 ▲29.85
Dashboard /wp-admin9.09 ▲5.7885.28 ▲30.71
Posts /wp-admin/edit.php9.09 ▲5.7395.59 ▲44.25
Add New Post /wp-admin/post-new.php11.01 ▲5.12121.65 ▲23.95
Media Library /wp-admin/upload.php9.09 ▲5.8588.78 ▲56.79
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius9.0972.88

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 307 new files
Database: no new tables, 10 new options
New WordPress options
widget_recent-comments
can_compress_scripts
db_upgraded
fs_active_plugins
genealogical_tree_active_ver
widget_theysaidso_widget
fs_debug_mode
widget_recent-posts
theysaidso_admin_options
fs_accounts

Browser metrics Passed 4 tests

An overview of browser requirements for Genealogical Tree - WordPress Family Tree
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,116 ▲36915.85 ▲1.589.39 ▲7.6730.38 ▼14.13
Dashboard /wp-admin2,405 ▲2256.67 ▲1.09129.94 ▲33.8574.54 ▲29.14
Posts /wp-admin/edit.php2,337 ▲2373.84 ▲1.8358.30 ▲18.3577.74 ▲37.59
Add New Post /wp-admin/post-new.php1,736 ▲21022.78 ▼0.73671.70 ▲35.3938.14 ▼9.88
Media Library /wp-admin/upload.php1,470 ▲734.60 ▲0.2993.98 ▼6.3588.36 ▲44.41
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius1,3093.5147.9060.40

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
The following items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/genealogical-tree/freemius/includes/class-freemius.php+8546
    Undefined property: stdClass::$plugins
  • Zombie WordPress options were found after uninstall: 10 options
    • fs_active_plugins
    • widget_theysaidso_widget
    • can_compress_scripts
    • fs_accounts
    • theysaidso_admin_options
    • genealogical_tree_active_ver
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • fs_debug_mode

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/genealogical-tree/admin/partials/genealogical-tree-meta-member-notes.php
  • 230× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Notice
      Trying to get property 'color' of non-object in wp-content/plugins/genealogical-tree/public/partials/genealogical-tree-settings.php on line 34
    • > PHP Notice
      Undefined variable: rand_id in wp-content/plugins/genealogical-tree/public/partials/genealogical-tree-settings.php on line 175
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/genealogical-tree/admin/partials/genealogical-tree-meta-member-notes.php on line 17
    • > PHP Notice
      Undefined variable: rand_id in wp-content/plugins/genealogical-tree/public/partials/genealogical-tree-settings.php on line 187
    • > PHP Notice
      Undefined variable: rand_id in wp-content/plugins/genealogical-tree/public/partials/genealogical-tree-settings.php on line 189
    • > PHP Notice
      Trying to get property 'style' of non-object in wp-content/plugins/genealogical-tree/public/partials/genealogical-tree-settings.php on line 30
    • > PHP Notice
      Undefined variable: rand_id in wp-content/plugins/genealogical-tree/public/partials/genealogical-tree-settings.php on line 191
    • > PHP Notice
      Trying to get property 'color' of non-object in wp-content/plugins/genealogical-tree/public/partials/genealogical-tree-settings.php on line 41
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/genealogical-tree/admin/partials/genealogical-tree-meta-member-notes.php on line 12
    • > PHP Notice
      Undefined variable: setting in wp-content/plugins/genealogical-tree/public/partials/genealogical-tree-settings.php on line 20

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
6 plugin tags: family history, family tree, genealogy, ged, ancestry...

genealogical-tree/genealogical-tree.php Passed 13 tests

The main PHP script in "Genealogical Tree - WordPress Family Tree" version 2.2.2 is automatically included on every request by WordPress
111 characters long description:
Genealogical Tree is a ultimate solution for creating and displaying family trees, family history on WordPress.

Code Analysis 95% from 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
There were no executable files found in this plugin73,535 lines of code in 205 files:
LanguageFilesBlank linesComment linesLines of code
PHP1629,09319,84965,370
PO File112,8255,0506,087
CSS178916792
JavaScript959121731
SVG401475
JSON20080

PHP code 0% from 2 tests

Analyzing cyclomatic complexity and code structure
Please fix the following
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 3,096)
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 187)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity75.56
▷ Minimum class complexity1.00
▷ Maximum class complexity3,096.00
Average method complexity4.96
▷ Minimum method complexity1.00
▷ Maximum method complexity187.00
Code structure
Namespaces5
Interfaces1
Traits9
Classes67
▷ Abstract classes22.99%
▷ Concrete classes6597.01%
▷ Final classes00.00%
Methods1,477
▷ Static methods23315.78%
▷ Public methods1,05671.50%
▷ Protected methods171.15%
▷ Private methods40427.35%
Functions109
▷ Named functions10596.33%
▷ Anonymous functions43.67%
Constants149
▷ Global constants10268.46%
▷ Class constants4731.54%
▷ Public constants47100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
32 PNG files occupy 0.88MB with 0.40MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
admin/img/dash/image.png28.58KB11.97KB▼ 58.11%
admin/img/add.png0.72KB0.75KB0.00%
admin/img/dash/spouse.png50.16KB18.79KB▼ 62.54%
admin/img/dash/contact.png32.14KB13.47KB▼ 58.10%