| Conditions | 10 |
| Paths | 32 |
| Total Lines | 813 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
| 1 | <?php |
||
| 810 | private function load_dependencies() { |
||
| 811 | |||
| 812 | /** |
||
| 813 | * The class responsible for orchestrating the actions and filters of the |
||
| 814 | * core plugin. |
||
| 815 | */ |
||
| 816 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-loader.php'; |
||
| 817 | |||
| 818 | // The class responsible for plugin uninstall. |
||
| 819 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-deactivator-feedback.php'; |
||
| 820 | |||
| 821 | /** |
||
| 822 | * The class responsible for defining internationalization functionality |
||
| 823 | * of the plugin. |
||
| 824 | */ |
||
| 825 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-i18n.php'; |
||
| 826 | |||
| 827 | /** |
||
| 828 | * WordLift's supported languages. |
||
| 829 | */ |
||
| 830 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-languages.php'; |
||
| 831 | |||
| 832 | /** |
||
| 833 | * WordLift's supported countries. |
||
| 834 | */ |
||
| 835 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-countries.php'; |
||
| 836 | |||
| 837 | /** |
||
| 838 | * Provide support functions to sanitize data. |
||
| 839 | */ |
||
| 840 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sanitizer.php'; |
||
| 841 | |||
| 842 | /** Services. */ |
||
| 843 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-log-service.php'; |
||
| 844 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-http-api.php'; |
||
| 845 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-redirect-service.php'; |
||
| 846 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-configuration-service.php'; |
||
| 847 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-type-service.php'; |
||
| 848 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-service.php'; |
||
| 849 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-link-service.php'; |
||
| 850 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-linked-data-service.php'; |
||
| 851 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-relation-service.php'; |
||
| 852 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-image-service.php'; |
||
| 853 | |||
| 854 | /** |
||
| 855 | * The Query builder. |
||
| 856 | */ |
||
| 857 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-query-builder.php'; |
||
| 858 | |||
| 859 | /** |
||
| 860 | * The Schema service. |
||
| 861 | */ |
||
| 862 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-service.php'; |
||
| 863 | |||
| 864 | /** |
||
| 865 | * The schema:url property service. |
||
| 866 | */ |
||
| 867 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-service.php'; |
||
| 868 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-url-property-service.php'; |
||
| 869 | |||
| 870 | /** |
||
| 871 | * The UI service. |
||
| 872 | */ |
||
| 873 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-ui-service.php'; |
||
| 874 | |||
| 875 | /** |
||
| 876 | * The Thumbnail service. |
||
| 877 | */ |
||
| 878 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-thumbnail-service.php'; |
||
| 879 | |||
| 880 | /** |
||
| 881 | * The Entity Types Taxonomy service. |
||
| 882 | */ |
||
| 883 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-taxonomy-service.php'; |
||
| 884 | |||
| 885 | /** |
||
| 886 | * The Entity service. |
||
| 887 | */ |
||
| 888 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-uri-service.php'; |
||
| 889 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-service.php'; |
||
| 890 | |||
| 891 | // Add the entity rating service. |
||
| 892 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rating-service.php'; |
||
| 893 | |||
| 894 | /** |
||
| 895 | * The User service. |
||
| 896 | */ |
||
| 897 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-user-service.php'; |
||
| 898 | |||
| 899 | /** |
||
| 900 | * The Timeline service. |
||
| 901 | */ |
||
| 902 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-timeline-service.php'; |
||
| 903 | |||
| 904 | /** |
||
| 905 | * The Topic Taxonomy service. |
||
| 906 | */ |
||
| 907 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-topic-taxonomy-service.php'; |
||
| 908 | |||
| 909 | /** |
||
| 910 | * The SPARQL service. |
||
| 911 | */ |
||
| 912 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sparql-service.php'; |
||
| 913 | |||
| 914 | /** |
||
| 915 | * The WordLift import service. |
||
| 916 | */ |
||
| 917 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-import-service.php'; |
||
| 918 | |||
| 919 | /** |
||
| 920 | * The WordLift URI service. |
||
| 921 | */ |
||
| 922 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-uri-service.php'; |
||
| 923 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-factory.php'; |
||
| 924 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-service.php'; |
||
| 925 | |||
| 926 | /** |
||
| 927 | * The WordLift rebuild service, used to rebuild the remote dataset using the local data. |
||
| 928 | */ |
||
| 929 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-listable.php'; |
||
| 930 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-rebuild-service.php'; |
||
| 931 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-reference-rebuild-service.php'; |
||
| 932 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-relation-rebuild-service.php'; |
||
| 933 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-relation-rebuild-adapter.php'; |
||
| 934 | |||
| 935 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/properties/class-wordlift-property-getter-factory.php'; |
||
| 936 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-attachment-service.php'; |
||
| 937 | |||
| 938 | /** |
||
| 939 | * Load the converters. |
||
| 940 | */ |
||
| 941 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/intf-wordlift-post-converter.php'; |
||
| 942 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-abstract-post-to-jsonld-converter.php'; |
||
| 943 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-postid-to-jsonld-converter.php'; |
||
| 944 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-to-jsonld-converter.php'; |
||
| 945 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-to-jsonld-converter.php'; |
||
| 946 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-website-converter.php'; |
||
| 947 | |||
| 948 | /** |
||
| 949 | * Load cache-related files. |
||
| 950 | */ |
||
| 951 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/cache/require.php'; |
||
| 952 | |||
| 953 | /** |
||
| 954 | * Load the content filter. |
||
| 955 | */ |
||
| 956 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-content-filter-service.php'; |
||
| 957 | |||
| 958 | /* |
||
| 959 | * Load the excerpt helper. |
||
| 960 | */ |
||
| 961 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-excerpt-helper.php'; |
||
| 962 | |||
| 963 | /** |
||
| 964 | * Load the JSON-LD service to publish entities using JSON-LD.s |
||
| 965 | * |
||
| 966 | * @since 3.8.0 |
||
| 967 | */ |
||
| 968 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-service.php'; |
||
| 969 | |||
| 970 | // The Publisher Service and the AJAX adapter. |
||
| 971 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-service.php'; |
||
| 972 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-ajax-adapter.php'; |
||
| 973 | |||
| 974 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-adapter.php'; |
||
| 975 | |||
| 976 | /** |
||
| 977 | * Load the WordLift key validation service. |
||
| 978 | */ |
||
| 979 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-key-validation-service.php'; |
||
| 980 | |||
| 981 | // Load the `Wordlift_Category_Taxonomy_Service` class definition. |
||
| 982 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-category-taxonomy-service.php'; |
||
| 983 | |||
| 984 | // Load the `Wordlift_Entity_Page_Service` class definition. |
||
| 985 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-page-service.php'; |
||
| 986 | |||
| 987 | /** Linked Data. */ |
||
| 988 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage.php'; |
||
| 989 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-storage.php'; |
||
| 990 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-property-storage.php'; |
||
| 991 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-taxonomy-storage.php'; |
||
| 992 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-schema-class-storage.php'; |
||
| 993 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-author-storage.php'; |
||
| 994 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-uri-storage.php'; |
||
| 995 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-image-storage.php'; |
||
| 996 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-related-storage.php'; |
||
| 997 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-url-property-storage.php'; |
||
| 998 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage-factory.php'; |
||
| 999 | |||
| 1000 | /** Linked Data Rendition. */ |
||
| 1001 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/intf-wordlift-sparql-tuple-rendition.php'; |
||
| 1002 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-default-sparql-tuple-rendition.php'; |
||
| 1003 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-address-sparql-tuple-rendition.php'; |
||
| 1004 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-sparql-tuple-rendition-factory.php'; |
||
| 1005 | |||
| 1006 | /** Services. */ |
||
| 1007 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-google-analytics-export-service.php'; |
||
| 1008 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-api-service.php'; |
||
| 1009 | |||
| 1010 | /** Adapters. */ |
||
| 1011 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-tinymce-adapter.php'; |
||
| 1012 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-newrelic-adapter.php'; |
||
| 1013 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-ajax-adapter.php'; |
||
| 1014 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-adapter.php'; |
||
| 1015 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-wprocket-adapter.php'; |
||
| 1016 | |||
| 1017 | /** Async Tasks. */ |
||
| 1018 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-async-task.php'; |
||
| 1019 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-sparql-query-async-task.php'; |
||
| 1020 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-push-references-async-task.php'; |
||
| 1021 | |||
| 1022 | /** Autocomplete. */ |
||
| 1023 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-adapter.php'; |
||
| 1024 | |||
| 1025 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-remote-image-service.php'; |
||
| 1026 | |||
| 1027 | /** Analytics */ |
||
| 1028 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/analytics/class-wordlift-analytics-connect.php'; |
||
| 1029 | |||
| 1030 | /** |
||
| 1031 | * The class responsible for defining all actions that occur in the admin area. |
||
| 1032 | */ |
||
| 1033 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin.php'; |
||
| 1034 | |||
| 1035 | /** |
||
| 1036 | * The class to customize the entity list admin page. |
||
| 1037 | */ |
||
| 1038 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-list.php'; |
||
| 1039 | |||
| 1040 | /** |
||
| 1041 | * The Entity Types Taxonomy Walker (transforms checkboxes into radios). |
||
| 1042 | */ |
||
| 1043 | global $wp_version; |
||
| 1044 | if ( version_compare( $wp_version, '5.3', '<' ) ) { |
||
| 1045 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker.php'; |
||
| 1046 | } else { |
||
| 1047 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker-5-3.php'; |
||
| 1048 | } |
||
| 1049 | |||
| 1050 | /** |
||
| 1051 | * The Notice service. |
||
| 1052 | */ |
||
| 1053 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-notice-service.php'; |
||
| 1054 | |||
| 1055 | /** |
||
| 1056 | * The PrimaShop adapter. |
||
| 1057 | */ |
||
| 1058 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-primashop-adapter.php'; |
||
| 1059 | |||
| 1060 | /** |
||
| 1061 | * The WordLift Dashboard service. |
||
| 1062 | */ |
||
| 1063 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-dashboard.php'; |
||
| 1064 | |||
| 1065 | /** |
||
| 1066 | * The admin 'Install wizard' page. |
||
| 1067 | */ |
||
| 1068 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-setup.php'; |
||
| 1069 | |||
| 1070 | /** |
||
| 1071 | * The WordLift entity type list admin page controller. |
||
| 1072 | */ |
||
| 1073 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-taxonomy-list-page.php'; |
||
| 1074 | |||
| 1075 | /** |
||
| 1076 | * The WordLift entity type settings admin page controller. |
||
| 1077 | */ |
||
| 1078 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-settings.php'; |
||
| 1079 | |||
| 1080 | /** |
||
| 1081 | * The admin 'Download Your Data' page. |
||
| 1082 | */ |
||
| 1083 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-download-your-data-page.php'; |
||
| 1084 | |||
| 1085 | /** |
||
| 1086 | * The admin 'WordLift Settings' page. |
||
| 1087 | */ |
||
| 1088 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/intf-wordlift-admin-element.php'; |
||
| 1089 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-element.php'; |
||
| 1090 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-radio-element.php'; |
||
| 1091 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select-element.php'; |
||
| 1092 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select2-element.php'; |
||
| 1093 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-language-select-element.php'; |
||
| 1094 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-country-select-element.php'; |
||
| 1095 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-tabs-element.php'; |
||
| 1096 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-author-element.php'; |
||
| 1097 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-publisher-element.php'; |
||
| 1098 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-page.php'; |
||
| 1099 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page.php'; |
||
| 1100 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-analytics-page.php'; |
||
| 1101 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page-action-link.php'; |
||
| 1102 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-analytics-page-action-link.php'; |
||
| 1103 | |||
| 1104 | /** Admin Pages */ |
||
| 1105 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-user-profile-page.php'; |
||
| 1106 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-status-page.php'; |
||
| 1107 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-search-rankings-page.php'; |
||
| 1108 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-admin-service.php'; |
||
| 1109 | |||
| 1110 | /** |
||
| 1111 | * The class responsible for defining all actions that occur in the public-facing |
||
| 1112 | * side of the site. |
||
| 1113 | */ |
||
| 1114 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-public.php'; |
||
| 1115 | |||
| 1116 | /** |
||
| 1117 | * The shortcode abstract class. |
||
| 1118 | */ |
||
| 1119 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-shortcode.php'; |
||
| 1120 | |||
| 1121 | /** |
||
| 1122 | * The Timeline shortcode. |
||
| 1123 | */ |
||
| 1124 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-timeline-shortcode.php'; |
||
| 1125 | |||
| 1126 | /** |
||
| 1127 | * The Navigator shortcode. |
||
| 1128 | */ |
||
| 1129 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-navigator-shortcode.php'; |
||
| 1130 | |||
| 1131 | /** |
||
| 1132 | * The Products Navigator shortcode. |
||
| 1133 | */ |
||
| 1134 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-products-navigator-shortcode.php'; |
||
| 1135 | |||
| 1136 | /** |
||
| 1137 | * The chord shortcode. |
||
| 1138 | */ |
||
| 1139 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-chord-shortcode.php'; |
||
| 1140 | |||
| 1141 | /** |
||
| 1142 | * The geomap shortcode. |
||
| 1143 | */ |
||
| 1144 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-geomap-shortcode.php'; |
||
| 1145 | |||
| 1146 | /** |
||
| 1147 | * The entity cloud shortcode. |
||
| 1148 | */ |
||
| 1149 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-shortcode.php'; |
||
| 1150 | |||
| 1151 | /** |
||
| 1152 | * The entity glossary shortcode. |
||
| 1153 | */ |
||
| 1154 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-alphabet-service.php'; |
||
| 1155 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-vocabulary-shortcode.php'; |
||
| 1156 | |||
| 1157 | /** |
||
| 1158 | * Faceted Search shortcode. |
||
| 1159 | */ |
||
| 1160 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-faceted-search-shortcode.php'; |
||
| 1161 | |||
| 1162 | /** |
||
| 1163 | * The ShareThis service. |
||
| 1164 | */ |
||
| 1165 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-sharethis-service.php'; |
||
| 1166 | |||
| 1167 | /** |
||
| 1168 | * The SEO service. |
||
| 1169 | */ |
||
| 1170 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-seo-service.php'; |
||
| 1171 | |||
| 1172 | /** |
||
| 1173 | * The AMP service. |
||
| 1174 | */ |
||
| 1175 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-amp-service.php'; |
||
| 1176 | |||
| 1177 | /** Widgets */ |
||
| 1178 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-widget.php'; |
||
| 1179 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-widget.php'; |
||
| 1180 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-context-cards.php'; |
||
| 1181 | |||
| 1182 | /* |
||
| 1183 | * Schema.org Services. |
||
| 1184 | * |
||
| 1185 | * @see https://github.com/insideout10/wordlift-plugin/issues/835 |
||
| 1186 | */ |
||
| 1187 | if ( WL_ALL_ENTITY_TYPES ) { |
||
| 1188 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-sync-service.php'; |
||
| 1189 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-property-service.php'; |
||
| 1190 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-class-service.php'; |
||
| 1191 | new Wordlift_Schemaorg_Sync_Service(); |
||
| 1192 | $schemaorg_property_service = new Wordlift_Schemaorg_Property_Service(); |
||
| 1193 | new Wordlift_Schemaorg_Class_Service(); |
||
| 1194 | } else { |
||
| 1195 | $schemaorg_property_service = null; |
||
| 1196 | } |
||
| 1197 | |||
| 1198 | $this->loader = new Wordlift_Loader(); |
||
| 1199 | /** |
||
| 1200 | * @since 3.30.0 |
||
| 1201 | */ |
||
| 1202 | $this->features_registry = Features_Registry::get_instance(); |
||
| 1203 | |||
| 1204 | // Instantiate a global logger. |
||
| 1205 | global $wl_logger; |
||
| 1206 | $wl_logger = Wordlift_Log_Service::get_logger( 'WordLift' ); |
||
| 1207 | |||
| 1208 | // Load the `wl-api` end-point. |
||
| 1209 | new Wordlift_Http_Api(); |
||
| 1210 | |||
| 1211 | // Load the Install Service. |
||
| 1212 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-service.php'; |
||
| 1213 | $this->install_service = new Wordlift_Install_Service(); |
||
| 1214 | |||
| 1215 | /** Services. */ |
||
| 1216 | // Create the configuration service. |
||
| 1217 | $this->configuration_service = new Wordlift_Configuration_Service(); |
||
| 1218 | $api_service = new Wordlift_Api_Service( $this->configuration_service ); |
||
| 1219 | |||
| 1220 | // Create an entity type service instance. It'll be later bound to the init action. |
||
| 1221 | $this->entity_post_type_service = new Wordlift_Entity_Post_Type_Service( Wordlift_Entity_Service::TYPE_NAME, $this->configuration_service->get_entity_base_path() ); |
||
| 1222 | |||
| 1223 | // Create an entity link service instance. It'll be later bound to the post_type_link and pre_get_posts actions. |
||
| 1224 | $this->entity_link_service = new Wordlift_Entity_Link_Service( $this->entity_post_type_service, $this->configuration_service->get_entity_base_path() ); |
||
| 1225 | |||
| 1226 | // Create an instance of the UI service. |
||
| 1227 | $this->ui_service = new Wordlift_UI_Service(); |
||
| 1228 | |||
| 1229 | // Create an instance of the Thumbnail service. Later it'll be hooked to post meta events. |
||
| 1230 | $this->thumbnail_service = new Wordlift_Thumbnail_Service(); |
||
| 1231 | |||
| 1232 | $this->sparql_service = new Wordlift_Sparql_Service(); |
||
| 1233 | $schema_url_property_service = new Wordlift_Schema_Url_Property_Service( $this->sparql_service ); |
||
| 1234 | $this->notice_service = new Wordlift_Notice_Service(); |
||
| 1235 | $this->relation_service = new Wordlift_Relation_Service(); |
||
| 1236 | |||
| 1237 | $entity_uri_cache_service = new Wordlift_File_Cache_Service( WL_TEMP_DIR . 'entity_uri/' ); |
||
| 1238 | $this->entity_uri_service = new Wordlift_Cached_Entity_Uri_Service( $this->configuration_service, $entity_uri_cache_service ); |
||
| 1239 | $this->entity_service = new Wordlift_Entity_Service( $this->ui_service, $this->relation_service, $this->entity_uri_service ); |
||
| 1240 | $this->user_service = new Wordlift_User_Service( $this->sparql_service, $this->entity_service ); |
||
| 1241 | |||
| 1242 | // Instantiate the JSON-LD service. |
||
| 1243 | $property_getter = Wordlift_Property_Getter_Factory::create( $this->entity_service ); |
||
| 1244 | |||
| 1245 | /** Linked Data. */ |
||
| 1246 | $this->storage_factory = new Wordlift_Storage_Factory( $this->entity_service, $this->user_service, $property_getter ); |
||
| 1247 | $this->rendition_factory = new Wordlift_Sparql_Tuple_Rendition_Factory( $this->entity_service ); |
||
| 1248 | |||
| 1249 | $this->schema_service = new Wordlift_Schema_Service( $this->storage_factory, $this->rendition_factory, $this->configuration_service ); |
||
| 1250 | |||
| 1251 | // Create a new instance of the Redirect service. |
||
| 1252 | $this->redirect_service = new Wordlift_Redirect_Service( $this->entity_uri_service ); |
||
| 1253 | $this->entity_type_service = new Wordlift_Entity_Type_Service( $this->schema_service ); |
||
| 1254 | |||
| 1255 | // Create a new instance of the Timeline service and Timeline shortcode. |
||
| 1256 | $this->timeline_service = new Wordlift_Timeline_Service( $this->entity_service, $this->entity_type_service ); |
||
| 1257 | |||
| 1258 | $this->entity_types_taxonomy_walker = new Wordlift_Entity_Types_Taxonomy_Walker(); |
||
| 1259 | |||
| 1260 | $this->topic_taxonomy_service = new Wordlift_Topic_Taxonomy_Service(); |
||
| 1261 | $this->entity_types_taxonomy_service = new Wordlift_Entity_Type_Taxonomy_Service(); |
||
| 1262 | |||
| 1263 | // Create an instance of the ShareThis service, later we hook it to the_content and the_excerpt filters. |
||
| 1264 | $this->sharethis_service = new Wordlift_ShareThis_Service(); |
||
| 1265 | |||
| 1266 | // Create an instance of the PrimaShop adapter. |
||
| 1267 | $this->primashop_adapter = new Wordlift_PrimaShop_Adapter(); |
||
| 1268 | |||
| 1269 | // Create an import service instance to hook later to WP's import function. |
||
| 1270 | $this->import_service = new Wordlift_Import_Service( $this->entity_post_type_service, $this->entity_service, $this->schema_service, $this->sparql_service, $this->configuration_service->get_dataset_uri() ); |
||
| 1271 | |||
| 1272 | $uri_service = new Wordlift_Uri_Service( $GLOBALS['wpdb'] ); |
||
| 1273 | |||
| 1274 | // Create the entity rating service. |
||
| 1275 | $this->rating_service = new Wordlift_Rating_Service( $this->entity_service, $this->entity_type_service, $this->notice_service ); |
||
| 1276 | |||
| 1277 | // Create entity list customization (wp-admin/edit.php). |
||
| 1278 | $this->entity_list_service = new Wordlift_Entity_List_Service( $this->rating_service ); |
||
| 1279 | |||
| 1280 | // Create a new instance of the Redirect service. |
||
| 1281 | $this->dashboard_service = new Wordlift_Dashboard_Service( $this->rating_service, $this->entity_service ); |
||
| 1282 | |||
| 1283 | // Create an instance of the Publisher Service and the AJAX Adapter. |
||
| 1284 | $this->publisher_service = new Wordlift_Publisher_Service( $this->configuration_service ); |
||
| 1285 | $this->property_factory = new Wordlift_Property_Factory( $schema_url_property_service ); |
||
| 1286 | $this->property_factory->register( Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service ); |
||
| 1287 | |||
| 1288 | $attachment_service = new Wordlift_Attachment_Service(); |
||
| 1289 | |||
| 1290 | // Instantiate the JSON-LD service. |
||
| 1291 | $property_getter = Wordlift_Property_Getter_Factory::create( $this->entity_service ); |
||
| 1292 | $this->post_to_jsonld_converter = new Wordlift_Post_To_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service ); |
||
| 1293 | $this->entity_post_to_jsonld_converter = new Wordlift_Entity_Post_To_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $property_getter, $schemaorg_property_service, $this->post_to_jsonld_converter ); |
||
|
|
|||
| 1294 | $this->postid_to_jsonld_converter = new Wordlift_Postid_To_Jsonld_Converter( $this->entity_service, $this->entity_post_to_jsonld_converter, $this->post_to_jsonld_converter ); |
||
| 1295 | $this->jsonld_website_converter = new Wordlift_Website_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service ); |
||
| 1296 | |||
| 1297 | $jsonld_cache = new Ttl_Cache( 'jsonld', 86400 ); |
||
| 1298 | $this->cached_postid_to_jsonld_converter = new Wordlift_Cached_Post_Converter( $this->postid_to_jsonld_converter, $this->configuration_service, $jsonld_cache ); |
||
| 1299 | $this->jsonld_service = new Wordlift_Jsonld_Service( $this->entity_service, $this->cached_postid_to_jsonld_converter, $this->jsonld_website_converter ); |
||
| 1300 | |||
| 1301 | /* |
||
| 1302 | * Load the `Wordlift_Term_JsonLd_Adapter`. |
||
| 1303 | * |
||
| 1304 | * @see https://github.com/insideout10/wordlift-plugin/issues/892 |
||
| 1305 | * |
||
| 1306 | * @since 3.20.0 |
||
| 1307 | */ |
||
| 1308 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-term-jsonld-adapter.php'; |
||
| 1309 | $term_jsonld_adapter = new Wordlift_Term_JsonLd_Adapter( $this->entity_uri_service, $this->jsonld_service ); |
||
| 1310 | $jsonld_service = new Jsonld_Service( |
||
| 1311 | $this->jsonld_service, |
||
| 1312 | $term_jsonld_adapter, |
||
| 1313 | new Jsonld_User_Service( $this->user_service ) ); |
||
| 1314 | new Jsonld_Endpoint( $jsonld_service, $this->entity_uri_service ); |
||
| 1315 | |||
| 1316 | // Prints the JSON-LD in the head. |
||
| 1317 | new Jsonld_Adapter( $this->jsonld_service ); |
||
| 1318 | |||
| 1319 | new Jsonld_By_Id_Endpoint( $this->jsonld_service, $this->entity_uri_service ); |
||
| 1320 | |||
| 1321 | $this->key_validation_service = new Wordlift_Key_Validation_Service( $this->configuration_service ); |
||
| 1322 | $this->content_filter_service = new Wordlift_Content_Filter_Service( $this->entity_service, $this->configuration_service, $this->entity_uri_service ); |
||
| 1323 | // Creating Faq Content filter service. |
||
| 1324 | $this->faq_content_filter_service = new Faq_Content_Filter(); |
||
| 1325 | $this->relation_rebuild_service = new Wordlift_Relation_Rebuild_Service( $this->content_filter_service, $this->entity_service ); |
||
| 1326 | $this->sample_data_service = new Wordlift_Sample_Data_Service( $this->entity_type_service, $this->configuration_service, $this->user_service ); |
||
| 1327 | $this->sample_data_ajax_adapter = new Wordlift_Sample_Data_Ajax_Adapter( $this->sample_data_service ); |
||
| 1328 | $this->reference_rebuild_service = new Wordlift_Reference_Rebuild_Service( $this->entity_service ); |
||
| 1329 | |||
| 1330 | $this->loader->add_action( 'enqueue_block_editor_assets', $this, 'add_wl_enabled_blocks' ); |
||
| 1331 | $this->loader->add_action( 'admin_enqueue_scripts', $this, 'add_wl_enabled_blocks' ); |
||
| 1332 | |||
| 1333 | /** |
||
| 1334 | * Filter: wl_feature__enable__blocks. |
||
| 1335 | * |
||
| 1336 | * @param bool whether the blocks needed to be registered, defaults to true. |
||
| 1337 | * |
||
| 1338 | * @return bool |
||
| 1339 | * @since 3.27.6 |
||
| 1340 | */ |
||
| 1341 | if ( apply_filters( 'wl_feature__enable__blocks', true ) ) { |
||
| 1342 | // Initialize the short-codes. |
||
| 1343 | new Async_Template_Decorator( new Wordlift_Navigator_Shortcode() ); |
||
| 1344 | new Wordlift_Chord_Shortcode(); |
||
| 1345 | new Wordlift_Geomap_Shortcode(); |
||
| 1346 | new Wordlift_Timeline_Shortcode(); |
||
| 1347 | new Wordlift_Related_Entities_Cloud_Shortcode( $this->relation_service ); |
||
| 1348 | new Wordlift_Vocabulary_Shortcode( $this->configuration_service ); |
||
| 1349 | new Async_Template_Decorator( new Wordlift_Faceted_Search_Shortcode() ); |
||
| 1350 | } |
||
| 1351 | |||
| 1352 | new Wordlift_Products_Navigator_Shortcode(); |
||
| 1353 | |||
| 1354 | |||
| 1355 | // Initialize the Context Cards Service |
||
| 1356 | $this->context_cards_service = new Wordlift_Context_Cards_Service(); |
||
| 1357 | |||
| 1358 | // Initialize the SEO service. |
||
| 1359 | new Wordlift_Seo_Service(); |
||
| 1360 | |||
| 1361 | // Initialize the AMP service. |
||
| 1362 | new Wordlift_AMP_Service( $this->jsonld_service ); |
||
| 1363 | |||
| 1364 | /** Services. */ |
||
| 1365 | $this->google_analytics_export_service = new Wordlift_Google_Analytics_Export_Service(); |
||
| 1366 | new Wordlift_Image_Service(); |
||
| 1367 | |||
| 1368 | /** Adapters. */ |
||
| 1369 | $this->entity_type_adapter = new Wordlift_Entity_Type_Adapter( $this->entity_type_service ); |
||
| 1370 | $this->publisher_ajax_adapter = new Wordlift_Publisher_Ajax_Adapter( $this->publisher_service ); |
||
| 1371 | $this->tinymce_adapter = new Wordlift_Tinymce_Adapter( $this ); |
||
| 1372 | //$this->faq_tinymce_adapter = new Faq_Tinymce_Adapter(); |
||
| 1373 | $this->relation_rebuild_adapter = new Wordlift_Relation_Rebuild_Adapter( $this->relation_rebuild_service ); |
||
| 1374 | |||
| 1375 | /* |
||
| 1376 | * Exclude our public js from WP-Rocket. |
||
| 1377 | * |
||
| 1378 | * @since 3.19.4 |
||
| 1379 | * |
||
| 1380 | * @see https://github.com/insideout10/wordlift-plugin/issues/842. |
||
| 1381 | */ |
||
| 1382 | new Wordlift_WpRocket_Adapter(); |
||
| 1383 | |||
| 1384 | // Create a Rebuild Service instance, which we'll later bound to an ajax call. |
||
| 1385 | $this->rebuild_service = new Wordlift_Rebuild_Service( |
||
| 1386 | $this->sparql_service, |
||
| 1387 | $uri_service |
||
| 1388 | ); |
||
| 1389 | |||
| 1390 | $that = $this; |
||
| 1391 | add_action( 'plugins_loaded', function () use ( $that ) { |
||
| 1392 | if ( ! apply_filters( 'wl_feature__enable__dataset-ng', false ) ) { |
||
| 1393 | new Wordlift_Linked_Data_Service( $that->entity_service, $that->entity_type_service, $that->schema_service, $that->sparql_service ); |
||
| 1394 | new Wordlift_Sparql_Query_Async_Task(); |
||
| 1395 | new Wordlift_Push_References_Async_Task(); |
||
| 1396 | } |
||
| 1397 | } ); |
||
| 1398 | |||
| 1399 | /** WordPress Admin UI. */ |
||
| 1400 | |||
| 1401 | // UI elements. |
||
| 1402 | $this->input_element = new Wordlift_Admin_Input_Element(); |
||
| 1403 | $this->radio_input_element = new Wordlift_Admin_Radio_Input_Element(); |
||
| 1404 | $this->select2_element = new Wordlift_Admin_Select2_Element(); |
||
| 1405 | $this->language_select_element = new Wordlift_Admin_Language_Select_Element(); |
||
| 1406 | $this->country_select_element = new Wordlift_Admin_Country_Select_Element(); |
||
| 1407 | $tabs_element = new Wordlift_Admin_Tabs_Element(); |
||
| 1408 | $this->publisher_element = new Wordlift_Admin_Publisher_Element( $this->configuration_service, $this->publisher_service, $tabs_element, $this->select2_element ); |
||
| 1409 | $this->author_element = new Wordlift_Admin_Author_Element( $this->publisher_service, $this->select2_element ); |
||
| 1410 | |||
| 1411 | $this->settings_page = new Wordlift_Admin_Settings_Page( $this->configuration_service, $this->entity_service, $this->input_element, $this->language_select_element, $this->country_select_element, $this->publisher_element, $this->radio_input_element ); |
||
| 1412 | $this->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link( $this->settings_page ); |
||
| 1413 | |||
| 1414 | $this->analytics_settings_page = new Wordlift_Admin_Settings_Analytics_Page( $this->configuration_service, $this->input_element, $this->radio_input_element ); |
||
| 1415 | $this->analytics_settings_page_action_link = new Wordlift_Admin_Settings_Analytics_Page_Action_Link( $this->analytics_settings_page ); |
||
| 1416 | $this->analytics_connect = new Wordlift_Analytics_Connect(); |
||
| 1417 | |||
| 1418 | // Pages. |
||
| 1419 | /* |
||
| 1420 | * Call the `wl_can_see_classification_box` filter to determine whether we can display the classification box. |
||
| 1421 | * |
||
| 1422 | * @since 3.20.3 |
||
| 1423 | * |
||
| 1424 | * @see https://github.com/insideout10/wordlift-plugin/issues/914 |
||
| 1425 | */ |
||
| 1426 | if ( apply_filters( 'wl_can_see_classification_box', true ) ) { |
||
| 1427 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-post-edit-page.php'; |
||
| 1428 | new Wordlift_Admin_Post_Edit_Page( $this ); |
||
| 1429 | } |
||
| 1430 | new Wordlift_Entity_Type_Admin_Service(); |
||
| 1431 | |||
| 1432 | // create an instance of the entity type list admin page controller. |
||
| 1433 | $this->entity_type_admin_page = new Wordlift_Admin_Entity_Taxonomy_List_Page(); |
||
| 1434 | |||
| 1435 | // create an instance of the entity type setting admin page controller. |
||
| 1436 | $this->entity_type_settings_admin_page = new Wordlift_Admin_Entity_Type_Settings(); |
||
| 1437 | |||
| 1438 | /** Widgets */ |
||
| 1439 | $this->related_entities_cloud_widget = new Wordlift_Related_Entities_Cloud_Widget(); |
||
| 1440 | |||
| 1441 | /* WordPress Admin. */ |
||
| 1442 | $this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page( $this->configuration_service ); |
||
| 1443 | $this->status_page = new Wordlift_Admin_Status_Page( $this->entity_service, $this->sparql_service ); |
||
| 1444 | |||
| 1445 | // Create an instance of the install wizard. |
||
| 1446 | $this->admin_setup = new Wordlift_Admin_Setup( $this->configuration_service, $this->key_validation_service, $this->entity_service, $this->language_select_element, $this->country_select_element ); |
||
| 1447 | |||
| 1448 | $this->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service( $this->entity_post_type_service ); |
||
| 1449 | |||
| 1450 | // User Profile. |
||
| 1451 | new Wordlift_Admin_User_Profile_Page( $this->author_element, $this->user_service ); |
||
| 1452 | |||
| 1453 | $this->entity_page_service = new Wordlift_Entity_Page_Service(); |
||
| 1454 | |||
| 1455 | // Load the debug service if WP is in debug mode. |
||
| 1456 | if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { |
||
| 1457 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-debug-service.php'; |
||
| 1458 | new Wordlift_Debug_Service( $this->entity_service, $uri_service ); |
||
| 1459 | } |
||
| 1460 | |||
| 1461 | // Remote Image Service. |
||
| 1462 | new Wordlift_Remote_Image_Service(); |
||
| 1463 | |||
| 1464 | /* |
||
| 1465 | * Provides mappings between post types and entity types. |
||
| 1466 | * |
||
| 1467 | * @since 3.20.0 |
||
| 1468 | * |
||
| 1469 | * @see https://github.com/insideout10/wordlift-plugin/issues/852. |
||
| 1470 | */ |
||
| 1471 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-batch-action.php'; |
||
| 1472 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-service.php'; |
||
| 1473 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-ajax-adapter.php'; |
||
| 1474 | |||
| 1475 | // Create an instance of the Mapping Service and assign it to the Ajax Adapter. |
||
| 1476 | new Wordlift_Mapping_Ajax_Adapter( new Wordlift_Mapping_Service( Wordlift_Entity_Type_Service::get_instance() ) ); |
||
| 1477 | |||
| 1478 | /* |
||
| 1479 | * Batch Operations. They're similar to Batch Actions but do not require working on post types. |
||
| 1480 | * |
||
| 1481 | * Eventually Batch Actions will become Batch Operations. |
||
| 1482 | * |
||
| 1483 | * @since 3.20.0 |
||
| 1484 | */ |
||
| 1485 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/intf-wordlift-batch-operation.php'; |
||
| 1486 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/class-wordlift-batch-operation-ajax-adapter.php'; |
||
| 1487 | |||
| 1488 | /* |
||
| 1489 | * Add the Search Keywords taxonomy to manage the Search Keywords on WLS. |
||
| 1490 | * |
||
| 1491 | * @link https://github.com/insideout10/wordlift-plugin/issues/761 |
||
| 1492 | * |
||
| 1493 | * @since 3.20.0 |
||
| 1494 | */ |
||
| 1495 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/search-keywords/class-wordlift-search-keyword-taxonomy.php'; |
||
| 1496 | new Wordlift_Search_Keyword_Taxonomy( $api_service ); |
||
| 1497 | |||
| 1498 | /* |
||
| 1499 | * Load the Mappings JSON-LD post processing. |
||
| 1500 | * |
||
| 1501 | * @since 3.25.0 |
||
| 1502 | */ |
||
| 1503 | |||
| 1504 | $mappings_dbo = new Mappings_DBO(); |
||
| 1505 | $default_rule_validator = new Taxonomy_Rule_Validator(); |
||
| 1506 | new Post_Type_Rule_Validator(); |
||
| 1507 | // Taxonomy term rule validator for validating rules for term pages. |
||
| 1508 | new Taxonomy_Term_Rule_Validator(); |
||
| 1509 | new Post_Taxonomy_Term_Rule_Validator(); |
||
| 1510 | $rule_validators_registry = new Rule_Validators_Registry( $default_rule_validator ); |
||
| 1511 | $rule_groups_validator = new Rule_Groups_Validator( $rule_validators_registry ); |
||
| 1512 | $mappings_validator = new Mappings_Validator( $mappings_dbo, $rule_groups_validator ); |
||
| 1513 | |||
| 1514 | new Url_To_Entity_Transform_Function( $this->entity_uri_service ); |
||
| 1515 | new Taxonomy_To_Terms_Transform_Function(); |
||
| 1516 | new Post_Id_To_Entity_Transform_Function(); |
||
| 1517 | $mappings_transform_functions_registry = new Mappings_Transform_Functions_Registry(); |
||
| 1518 | |||
| 1519 | /** |
||
| 1520 | * @since 3.27.1 |
||
| 1521 | * Intiailize the acf group data formatter. |
||
| 1522 | */ |
||
| 1523 | new Acf_Group_Formatter(); |
||
| 1524 | new Jsonld_Converter( $mappings_validator, $mappings_transform_functions_registry ); |
||
| 1525 | |||
| 1526 | /** |
||
| 1527 | * @since 3.26.0 |
||
| 1528 | * Initialize the Faq JSON LD converter here - disabled. |
||
| 1529 | */ |
||
| 1530 | // new Faq_To_Jsonld_Converter(); |
||
| 1531 | /* |
||
| 1532 | * Use the Templates Ajax Endpoint to load HTML templates for the legacy Angular app via admin-ajax.php |
||
| 1533 | * end-point. |
||
| 1534 | * |
||
| 1535 | * @see https://github.com/insideout10/wordlift-plugin/issues/834 |
||
| 1536 | * @since 3.24.4 |
||
| 1537 | */ |
||
| 1538 | new Templates_Ajax_Endpoint(); |
||
| 1539 | // Call this static method to register FAQ routes to rest api - disabled |
||
| 1540 | //Faq_Rest_Controller::register_routes(); |
||
| 1541 | |||
| 1542 | /* |
||
| 1543 | * Create a singleton for the Analysis_Response_Ops_Factory. |
||
| 1544 | */ |
||
| 1545 | $entity_helper = new Entity_Helper( $this->entity_uri_service, $this->entity_service ); |
||
| 1546 | new Analysis_Response_Ops_Factory( |
||
| 1547 | $this->entity_uri_service, |
||
| 1548 | $this->entity_service, |
||
| 1549 | $this->entity_type_service, |
||
| 1550 | $this->storage_factory->post_images(), |
||
| 1551 | $entity_helper |
||
| 1552 | ); |
||
| 1553 | |||
| 1554 | /** WL Autocomplete. */ |
||
| 1555 | $autocomplete_service = new All_Autocomplete_Service( array( |
||
| 1556 | new Local_Autocomplete_Service(), |
||
| 1557 | new Linked_Data_Autocomplete_Service( $this->configuration_service, $entity_helper, $this->entity_uri_service, $this->entity_service ), |
||
| 1558 | ) ); |
||
| 1559 | $this->autocomplete_adapter = new Wordlift_Autocomplete_Adapter( $autocomplete_service ); |
||
| 1560 | |||
| 1561 | /** |
||
| 1562 | * @since 3.27.2 |
||
| 1563 | * Integrate the recipe maker jsonld & set recipe |
||
| 1564 | * as default entity type to the wprm_recipe CPT. |
||
| 1565 | */ |
||
| 1566 | new Recipe_Maker_Post_Type_Hook(); |
||
| 1567 | $recipe_maker_validation_service = new Recipe_Maker_Validation_Service(); |
||
| 1568 | new Recipe_Maker_Jsonld_Hook( $attachment_service, $recipe_maker_validation_service ); |
||
| 1569 | new Recipe_Maker_After_Get_Jsonld_Hook( $recipe_maker_validation_service ); |
||
| 1570 | new Recipe_Maker_Warning( $recipe_maker_validation_service ); |
||
| 1571 | new Yoast_Jsonld( $recipe_maker_validation_service ); |
||
| 1572 | |||
| 1573 | /** |
||
| 1574 | * @since 3.27.4 |
||
| 1575 | * Add the faq duplicate markup hook. |
||
| 1576 | */ |
||
| 1577 | new Faq_Duplicate_Markup_Remover(); |
||
| 1578 | /** |
||
| 1579 | * @since 3.27.8 |
||
| 1580 | * @see https://github.com/insideout10/wordlift-plugin/issues/1248 |
||
| 1581 | */ |
||
| 1582 | new Key_Validation_Notice( $this->key_validation_service, $this->configuration_service ); |
||
| 1583 | /** |
||
| 1584 | |||
| 1585 | * @since 3.28.0 |
||
| 1586 | * @see https://github.com/insideout10/wordlift-plugin/issues?q=assignee%3Anaveen17797+is%3Aopen |
||
| 1587 | */ |
||
| 1588 | new Entity_No_Index_Flag(); |
||
| 1589 | |||
| 1590 | /** |
||
| 1591 | * @since 3.29.0 |
||
| 1592 | * @see https://github.com/insideout10/wordlift-plugin/issues/1304 |
||
| 1593 | */ |
||
| 1594 | new Entity_Rest_Service( $this->entity_type_service ); |
||
| 1595 | |||
| 1596 | /** |
||
| 1597 | * Expand author in to references. |
||
| 1598 | * @since 3.30.0 |
||
| 1599 | * @see https://github.com/insideout10/wordlift-plugin/issues/1318 |
||
| 1600 | */ |
||
| 1601 | |||
| 1602 | add_action( 'plugins_loaded', function () use ( $that ) { |
||
| 1603 | |||
| 1604 | if ( apply_filters( 'wl_feature__enable__article-wrapper', false ) ) { |
||
| 1605 | new Jsonld_Article_Wrapper( Wordlift_Post_To_Jsonld_Converter::get_instance(), $that->cached_postid_to_jsonld_converter ); |
||
| 1606 | } |
||
| 1607 | |||
| 1608 | if ( apply_filters( 'wl_feature__enable__match-terms', false ) ) { |
||
| 1609 | $vocabulary_loader = new Vocabulary_Loader(); |
||
| 1610 | $vocabulary_loader->init_vocabulary(); |
||
| 1611 | } |
||
| 1612 | |||
| 1613 | } ); |
||
| 1614 | |||
| 1615 | /** |
||
| 1616 | * @since 3.30.0 |
||
| 1617 | * Add a checkbox to user option screen for wordlift admin. |
||
| 1618 | */ |
||
| 1619 | $wordlift_admin_checkbox = new Admin_User_Option(); |
||
| 1620 | $wordlift_admin_checkbox->connect_hook(); |
||
| 1621 | |||
| 1622 | } |
||
| 1623 | |||
| 2077 |
Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code: