68% treepress

Code Review | TreePress - Easy Family Trees & Ancestor Profiles

WordPress plugin TreePress - Easy Family Trees & Ancestor Profiles scored68%from 54 tests.

About plugin

  • Plugin page: treepress
  • Plugin version: 3.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.3
  • WordPress version: 6.3.1
  • First release: Jan 31, 2019
  • Latest release: Oct 31, 2023
  • Number of updates: 122
  • Update frequency: every 14.2 days
  • Top authors: blackandwhitedigital (70.49%)iqasim (29.51%)bdkabiruddin (1.64%)

Code review

54 tests

User reviews

16 reviews

Install metrics

800+ active /31,353 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
Install script ran successfully

Server metrics [RAM: ▲0.66MB] [CPU: ▲0.12ms] 75% from 4 tests

This is a short check of server-side resources used by TreePress - Easy Family Trees & Ancestor Profiles
It is recommended to improve the following
  • CPU: Total CPU usage must kept under 500.00ms (currently 2,117.66ms on /wp-admin/admin.php?page=treepress-account-settings)
PageMemory (MB)CPU Time (ms)
Home /4.16 ▲0.7041.91 ▼2.17
Dashboard /wp-admin4.01 ▲0.7051.56 ▼3.94
Posts /wp-admin/edit.php4.06 ▲0.7053.18 ▲7.37
Add New Post /wp-admin/post-new.php6.72 ▲0.8397.24 ▼0.78
Media Library /wp-admin/upload.php3.77 ▲0.5442.70 ▲7.72
Options /wp-admin/admin.php?page=treepress-options3.8038.73
Account Settings /wp-admin/admin.php?page=treepress-account-settings4.012,117.66
All Members /wp-admin/edit.php?post_type=member3.9742.89
Family Groups /wp-admin/edit-tags.php?taxonomy=family-group&post_type=member3.9339.61
Add Family /wp-admin/post-new.php?post_type=family4.1558.10
Add Member /wp-admin/post-new.php?post_type=member4.4252.11
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius4.0940.66
All Charts /wp-admin/edit.php?post_type=chart3.9745.87
All Families /wp-admin/edit.php?post_type=family3.9739.55
Add Chart /wp-admin/post-new.php?post_type=chart4.4056.16

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 518 new files
Database: no new tables, 11 new options
New WordPress options
fs_active_plugins
fs_accounts
theysaidso_admin_options
fs_debug_mode
db_upgraded
widget_recent-posts
treepress_activatation_time
treepress_version
widget_theysaidso_widget
widget_recent-comments
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for TreePress - Easy Family Trees & Ancestor Profiles
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,012 ▲25114.08 ▼0.277.67 ▲5.9330.18 ▼13.27
Dashboard /wp-admin2,293 ▲1135.14 ▼0.53106.21 ▲8.4146.52 ▲4.55
Posts /wp-admin/edit.php2,204 ▲1072.50 ▲0.5237.88 ▲2.3033.70 ▼8.53
Add New Post /wp-admin/post-new.php1,604 ▲7823.52 ▲0.61722.53 ▲31.1037.29 ▼19.86
Media Library /wp-admin/upload.php1,495 ▲984.70 ▲0.4098.11 ▼14.1742.64 ▲0.35
Options /wp-admin/admin.php?page=treepress-options9742.3127.1833.26
Account Settings /wp-admin/admin.php?page=treepress-account-settings1,0662.3829.7359.76
All Members /wp-admin/edit.php?post_type=member1,2142.5735.5631.74
Family Groups /wp-admin/edit-tags.php?taxonomy=family-group&post_type=member1,3912.4432.3135.41
Add Family /wp-admin/post-new.php?post_type=family2,5634.30104.4242.99
Add Member /wp-admin/post-new.php?post_type=member2,2633.3276.6240.30
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius1,1642.3029.8927.29
All Charts /wp-admin/edit.php?post_type=chart1,2172.4534.8130.99
All Families /wp-admin/edit.php?post_type=family1,1932.4534.5729.33
Add Chart /wp-admin/post-new.php?post_type=chart3,7254.3076.8152.09

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/treepress/freemius/includes/class-freemius.php+8546
    Undefined property: stdClass::$plugins
  • This plugin does not fully uninstall, leaving 11 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • fs_debug_mode
    • fs_accounts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • fs_active_plugins
    • treepress_activatation_time
    • db_upgraded
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

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
Almost there! Just fix the following items
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/treepress/public/partials/treepress-public-display.php
    • > /wp-content/plugins/treepress/admin/partials/treepress-admin-display.php
  • 191× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PhpGedcom\\Parser\\Component' not found in wp-content/plugins/treepress/php-gedcom/library/PhpGedcom/Parser/Subn.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'PhpGedcom\\Record\\Indi\\Lds' not found in wp-content/plugins/treepress/php-gedcom/library/PhpGedcom/Record/Indi/Slgc.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'PhpGedcom\\Parser\\Indi\\Even' not found in wp-content/plugins/treepress/php-gedcom/library/PhpGedcom/Parser/Indi/Will.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'PhpGedcom\\Record\\Indi\\Attr' not found in wp-content/plugins/treepress/php-gedcom/library/PhpGedcom/Record/Indi/Occu.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'PhpGedcom\\Parser\\Fam\\Even' not found in wp-content/plugins/treepress/php-gedcom/library/PhpGedcom/Parser/Fam/Divf.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'PhpGedcom\\Parser\\Component' not found in wp-content/plugins/treepress/php-gedcom/library/PhpGedcom/Parser/Repo.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'PhpGedcom\\Parser\\Indi\\Even' not found in wp-content/plugins/treepress/php-gedcom/library/PhpGedcom/Parser/Indi/Ordn.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'PhpGedcom\\Record\\Indi\\Attr' not found in wp-content/plugins/treepress/php-gedcom/library/PhpGedcom/Record/Indi/Nchi.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/treepress/php-gedcom/tests/library/Gedcom/ParserTest.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'PhpGedcom\\Record' not found in wp-content/plugins/treepress/php-gedcom/library/PhpGedcom/Record/Refn.php:24

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
7 plugin tags: family history, genealogy, ftm, ancestry, family tree...

treepress/treepress.php Passed 13 tests

This is the main PHP file of "TreePress - Easy Family Trees & Ancestor Profiles" version 3.0.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
96 characters long description:
This is a short description of what the plugin does. It's displayed in the WordPress admin area.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin64,071 lines of code in 438 files:
LanguageFilesBlank linesComment linesLines of code
PHP34310,48323,88744,907
JavaScript712,77086916,264
CSS17168782,014
PO File1315342777
Markdown220057
JSON20025
YAML14019
XML1008

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Please tend to the following items
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 3,096)
Cyclomatic complexity
Average complexity per logical line of code0.53
Average class complexity22.58
▷ Minimum class complexity1.00
▷ Maximum class complexity3,096.00
Average method complexity4.18
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces27
Interfaces4
Traits0
Classes255
▷ Abstract classes72.75%
▷ Concrete classes24897.25%
▷ Final classes00.00%
Methods1,788
▷ Static methods27415.32%
▷ Public methods1,37977.13%
▷ Protected methods181.01%
▷ Private methods39121.87%
Functions107
▷ Named functions10497.20%
▷ Anonymous functions32.80%
Constants149
▷ Global constants10167.79%
▷ Class constants4832.21%
▷ Public constants48100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
7 PNG files occupy 0.74MB with 0.38MB 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%
freemius/assets/img/treepress.png34.13KB16.53KB▼ 51.55%
public/imgs/no-avatar.png8.86KB3.83KB▼ 56.80%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
admin/imgs/Banner.png691.19KB268.46KB▼ 61.16%