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