73% laika-pedigree-tree

Code Review | Laika Pedigree Tree

WordPress plugin Laika Pedigree Tree scored73%from 54 tests.

About plugin

  • Plugin page: laika-pedigree-tree
  • Plugin version: 1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.7.2
  • WordPress version: 6.3.1
  • First release: Oct 11, 2016
  • Latest release: Sep 28, 2017
  • Number of updates: 96
  • Update frequency: every 3.7 days
  • Top authors: burria (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

80+ active /2,927 total downloads

Benchmarks

Plugin footprint 83% 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: ▼0.55MB] [CPU: ▼18.81ms] Passed 4 tests

Analyzing server-side resources used by Laika Pedigree Tree
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1438.48 ▼4.91
Dashboard /wp-admin3.44 ▲0.1349.76 ▼5.65
Posts /wp-admin/edit.php3.55 ▲0.2050.25 ▼0.27
Add New Post /wp-admin/post-new.php3.28 ▼2.6037.71 ▼64.42
Media Library /wp-admin/upload.php3.36 ▲0.1338.65 ▲5.68
Laika Fields Configuration /wp-admin/options-general.php?page=laika-fields3.3232.31
Add New /wp-admin/post-new.php?post_type=laika_pt_type3.2836.62
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=laika_pt_type3.3538.41
Laika Configuration /wp-admin/options-general.php?page=laika-options3.3335.39
Laika /wp-admin/edit.php?post_type=laika_pt_type3.4138.70

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 20 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
can_compress_scripts
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

Laika Pedigree Tree: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,830 ▲6913.94 ▼0.411.68 ▼0.1342.27 ▼3.42
Dashboard /wp-admin2,221 ▲475.57 ▲0.0492.81 ▼4.8875.21 ▲27.99
Posts /wp-admin/edit.php2,145 ▲451.96 ▼0.0738.40 ▼1.5134.05 ▼2.82
Add New Post /wp-admin/post-new.php1,576 ▲4822.97 ▲0.15650.27 ▲2.06180.60 ▲130.64
Media Library /wp-admin/upload.php1,441 ▲414.19 ▼0.0499.71 ▼3.9677.76 ▲33.65
Laika Fields Configuration /wp-admin/options-general.php?page=laika-fields8841.9634.4331.97
Add New /wp-admin/post-new.php?post_type=laika_pt_type2,4067.65173.72121.31
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=laika_pt_type1,3542.1228.3037.76
Laika Configuration /wp-admin/options-general.php?page=laika-options9732.0324.5530.66
Laika /wp-admin/edit.php?post_type=laika_pt_type1,1161.8732.4030.20

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • 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)
Please fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=laika_pt_type
    • > Notice in wp-content/plugins/laika-pedigree-tree/laika-core/customtype.php+142
    Undefined index: FIELD_NONB
    • > GET request to /wp-admin/post-new.php?post_type=laika_pt_type
    • > Notice in wp-content/plugins/laika-pedigree-tree/laika-core/customtype.php+97
    Undefined variable: laika_id_loop
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=laika_pt_type
    • > Warning in wp-content/plugins/laika-pedigree-tree/laika-core/customtype-fields.php+125
    sizeof(): Parameter must be an array or an object that implements Countable
    • > GET request to /wp-admin/post-new.php?post_type=laika_pt_type
    • > Notice in wp-content/plugins/laika-pedigree-tree/laika-core/customtype-fields.php+105
    Undefined variable: laika_id_loop_f
    • > GET request to /wp-admin/post-new.php?post_type=laika_pt_type
    • > Notice in wp-content/plugins/laika-pedigree-tree/laika-core/customtype-fields.php+125
    Undefined variable: laika_id_loop_m
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=laika_pt_type
    • > request to
    • > Notice in wp-config.php+20
    Undefined index: REQUEST_METHOD

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/laika-pedigree-tree/laika-core/customtype-fields.php
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/laika-pedigree-tree/laika-core/customtype-display-fields.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
8 plugin tags: dog, pedigree, laika, family, pets...

laika-pedigree-tree/laika-pedigree-tree.php Passed 13 tests

"Laika Pedigree Tree" version 1.4's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
21 characters long description:
Draws a pedigree tree

Code Analysis Passed 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 plugin1,792 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP10308621,328
CSS24611246
PO File26870168
JavaScript114250

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.54
Average class complexity12.67
▷ Minimum class complexity1.00
▷ Maximum class complexity33.00
Average method complexity5.38
▷ Minimum method complexity1.00
▷ Maximum method complexity33.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods8
▷ Static methods112.50%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions20
▷ Named functions20100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
2 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/icon.png0.55KB0.33KB▼ 38.75%
images/cross.png0.25KB0.11KB▼ 57.20%