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