This repository was archived by the owner on Oct 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvarsfile.py
More file actions
44 lines (44 loc) · 2.07 KB
/
varsfile.py
File metadata and controls
44 lines (44 loc) · 2.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
plugin_header = ["Plugin Name:", "Plugin URI:", "Description:", "Version:", "Author:", "Author URI:", "Text Domain:", "Domain Path:", "Network:", "Site Wide Only:", "License:", "License URI:", "Theme Name:", "Theme URI:", "Template Name:"]
plugin_api = ["has_filter", "add_filter", "apply_filters", "apply_filters_ref_array", "current_filter", "remove_filter", "remove_all_filters", "doing_filter", "has_action", "add_action", "do_action", "do_action_ref_array", "did_action", "remove_action", "remove_all_actions", "doing_action", "register_activation_hook", "register_uninstall_hook", "register_deactivation_hook"]
plugin_ref = ["include", "require", "include_once", "require_once", "get_template_part"]
func_before_regex = r"(?<![a-zA-Z0-9\_])"
func_after_regex = r"(?=(\s*(\/\*.*\*\/)*(\/\/.*\n+)*(\#.*\n+)*\())" # Catches intermittent php comments & newline between function name and open parentheses
ph_before_regex = r"(\n)[^\S\n]*(\/\*)?[^\S\n]*(\*)*[^\S\n]*"
ph_after_regex = r"[^\S\n]+"
version_regex = r"[^\S\n]*([0-9]+\.)+[0-9]+"
cutoff_score_percentage = 90
header_score = 3
api_score = 2
ref_score = 1
table_report = "table_report.csv"
files_keyword = "Plugin Files"
can_plugin_keyword = "Canonical Plugin Name"
num_plugin_keyword = "Number of Plugin Files"
plugin_keywords = ["Plugin Name", "X-Plugin Name", "Theme Name"]
plugin_keyword = "Plugin Name"
theme_keyword = "Theme Name"
wnum_keyword = "Website Count"
version_keyword = "Latest Version"
change_keyword = "Changes"
orphan_keyword = "Orphaned Plugins"
del_keyword = "Deleted"
path_keyword = "Plugin Path"
score_keyword = "Plugin Score"
api_keyword = "API"
ast_keyword = "AST"
ref_keyword = "Referenced Files"
em_keyword = "Extension Match"
jsons_regex_folder = "./JSONS_REGEX/"
jsons_ast_folder = "./JSONS_AST/"
block_size = 65536
db_name = "hashes.db"
table_name = "main_table"
hash_list = "hash"
listing = "listing" # blacklist is 0, greylist is 1, whitelist is 2
wp_author = "Author"
wp_author_uri = "Author URI"
wp_version = "Version"
wp_plugin_uri = "Plugin URI"
wp_theme_uri = "Theme URI"
wp_license = "License"
wp_description = "Description"