94% lens-calculator

Code Review | CCTV Lens Calculator

WordPress plugin CCTV Lens Calculator scored 94% from 54 tests.

About plugin

  • Plugin page: lens-calculator
  • Plugin version: 1.2.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.6.0
  • WordPress version: 5.8.1
  • First release: Sep 27, 2016
  • Latest release: May 20, 2021
  • Number of updates: 36
  • Update frequency: every 47.1 days
  • Top authors: Zaanmedia (72.22%)patrickgroot (30.56%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 2,422 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼148.13ms] Passed 4 tests

This is a short check of server-side resources used by CCTV Lens Calculator
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.89 ▲0.1739.62 ▲18.29
Dashboard /wp-admin3.11 ▲0.0646.02 ▼4.00
Posts /wp-admin/edit.php3.16 ▲0.0639.21 ▼2.25
Add New Post /wp-admin/post-new.php5.47 ▲0.0488.12 ▼585.19
Media Library /wp-admin/upload.php3.05 ▲0.0535.04 ▼1.07

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 12 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for CCTV Lens Calculator
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,679 ▲8415.85 ▲0.389.21 ▼0.1149.15 ▼4.16
Dashboard /wp-admin2,970 ▲365.89 ▼0.04143.11 ▼10.13124.06 ▲2.35
Posts /wp-admin/edit.php2,739 ▼02.70 ▲0.0168.33 ▼4.0991.65 ▼3.33
Add New Post /wp-admin/post-new.php1,683 ▼018.78 ▲0.11390.15 ▼5.85119.05 ▲5.03
Media Library /wp-admin/upload.php1,810 ▼05.02 ▲0.00153.82 ▼17.39123.64 ▲1.93

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/lens-calculator/lenscalculator.php:22

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 93% from 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: correct lenses, cctv, security, lens, camera...

lens-calculator/lenscalculator.php 85% from 13 tests

This is the main PHP file of "CCTV Lens Calculator" version 1.2.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 300 characters long)
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("lens-calculator.php" instead of "lenscalculator.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin482 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PO File389127272
PHP12229113
JavaScript18267
CSS10030

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.10
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
There were not PNG files found in your plugin