| Conditions | 3 |
| Paths | 2 |
| Total Lines | 558 |
| 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 |
||
| 758 | private function load_dependencies() { |
||
|
|
|||
| 759 | |||
| 760 | /** |
||
| 761 | * The class responsible for orchestrating the actions and filters of the |
||
| 762 | * core plugin. |
||
| 763 | */ |
||
| 764 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-loader.php'; |
||
| 765 | |||
| 766 | // The class responsible for plugin uninstall. |
||
| 767 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-deactivator-feedback.php'; |
||
| 768 | |||
| 769 | /** |
||
| 770 | * The class responsible for defining internationalization functionality |
||
| 771 | * of the plugin. |
||
| 772 | */ |
||
| 773 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-i18n.php'; |
||
| 774 | |||
| 775 | /** |
||
| 776 | * WordLift's supported languages. |
||
| 777 | */ |
||
| 778 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-languages.php'; |
||
| 779 | |||
| 780 | /** |
||
| 781 | * Provide support functions to sanitize data. |
||
| 782 | */ |
||
| 783 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sanitizer.php'; |
||
| 784 | |||
| 785 | /** Installs. */ |
||
| 786 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install.php'; |
||
| 787 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-service.php'; |
||
| 788 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-1-0-0.php'; |
||
| 789 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-3-10-0.php'; |
||
| 790 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-3-12-0.php'; |
||
| 791 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-3-14-0.php'; |
||
| 792 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-3-15-0.php'; |
||
| 793 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-3-18-0.php'; |
||
| 794 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-3-18-3.php'; |
||
| 795 | |||
| 796 | /** Services. */ |
||
| 797 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-log-service.php'; |
||
| 798 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-http-api.php'; |
||
| 799 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-redirect-service.php'; |
||
| 800 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-configuration-service.php'; |
||
| 801 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-type-service.php'; |
||
| 802 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-service.php'; |
||
| 803 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-link-service.php'; |
||
| 804 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-linked-data-service.php'; |
||
| 805 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-relation-service.php'; |
||
| 806 | |||
| 807 | /** |
||
| 808 | * The Query builder. |
||
| 809 | */ |
||
| 810 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-query-builder.php'; |
||
| 811 | |||
| 812 | /** |
||
| 813 | * The Schema service. |
||
| 814 | */ |
||
| 815 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-service.php'; |
||
| 816 | |||
| 817 | /** |
||
| 818 | * The schema:url property service. |
||
| 819 | */ |
||
| 820 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-service.php'; |
||
| 821 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-url-property-service.php'; |
||
| 822 | |||
| 823 | /** |
||
| 824 | * The UI service. |
||
| 825 | */ |
||
| 826 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-ui-service.php'; |
||
| 827 | |||
| 828 | /** |
||
| 829 | * The Thumbnail service. |
||
| 830 | */ |
||
| 831 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-thumbnail-service.php'; |
||
| 832 | |||
| 833 | /** |
||
| 834 | * The Entity Types Taxonomy service. |
||
| 835 | */ |
||
| 836 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-taxonomy-service.php'; |
||
| 837 | |||
| 838 | /** |
||
| 839 | * The Entity service. |
||
| 840 | */ |
||
| 841 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-uri-service.php'; |
||
| 842 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-service.php'; |
||
| 843 | |||
| 844 | // Add the entity rating service. |
||
| 845 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rating-service.php'; |
||
| 846 | |||
| 847 | /** |
||
| 848 | * The User service. |
||
| 849 | */ |
||
| 850 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-user-service.php'; |
||
| 851 | |||
| 852 | /** |
||
| 853 | * The Timeline service. |
||
| 854 | */ |
||
| 855 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-timeline-service.php'; |
||
| 856 | |||
| 857 | /** |
||
| 858 | * The Topic Taxonomy service. |
||
| 859 | */ |
||
| 860 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-topic-taxonomy-service.php'; |
||
| 861 | |||
| 862 | /** |
||
| 863 | * The SPARQL service. |
||
| 864 | */ |
||
| 865 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sparql-service.php'; |
||
| 866 | |||
| 867 | /** |
||
| 868 | * The WordLift import service. |
||
| 869 | */ |
||
| 870 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-import-service.php'; |
||
| 871 | |||
| 872 | /** |
||
| 873 | * The WordLift URI service. |
||
| 874 | */ |
||
| 875 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-uri-service.php'; |
||
| 876 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-factory.php'; |
||
| 877 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-service.php'; |
||
| 878 | |||
| 879 | /** |
||
| 880 | * The WordLift rebuild service, used to rebuild the remote dataset using the local data. |
||
| 881 | */ |
||
| 882 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-listable.php'; |
||
| 883 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-rebuild-service.php'; |
||
| 884 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-reference-rebuild-service.php'; |
||
| 885 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-relation-rebuild-service.php'; |
||
| 886 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-relation-rebuild-adapter.php'; |
||
| 887 | |||
| 888 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/properties/class-wordlift-property-getter-factory.php'; |
||
| 889 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-attachment-service.php'; |
||
| 890 | |||
| 891 | /** |
||
| 892 | * Load the converters. |
||
| 893 | */ |
||
| 894 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/intf-wordlift-post-converter.php'; |
||
| 895 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-abstract-post-to-jsonld-converter.php'; |
||
| 896 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-postid-to-jsonld-converter.php'; |
||
| 897 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-to-jsonld-converter.php'; |
||
| 898 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-to-jsonld-converter.php'; |
||
| 899 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-website-converter.php'; |
||
| 900 | |||
| 901 | /** |
||
| 902 | * Load cache-related files. |
||
| 903 | */ |
||
| 904 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/cache/require.php'; |
||
| 905 | |||
| 906 | /** |
||
| 907 | * Load the content filter. |
||
| 908 | */ |
||
| 909 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-content-filter-service.php'; |
||
| 910 | |||
| 911 | /* |
||
| 912 | * Load the excerpt helper. |
||
| 913 | */ |
||
| 914 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-excerpt-helper.php'; |
||
| 915 | |||
| 916 | /** |
||
| 917 | * Load the JSON-LD service to publish entities using JSON-LD.s |
||
| 918 | * |
||
| 919 | * @since 3.8.0 |
||
| 920 | */ |
||
| 921 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-service.php'; |
||
| 922 | |||
| 923 | // The Publisher Service and the AJAX adapter. |
||
| 924 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-service.php'; |
||
| 925 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-ajax-adapter.php'; |
||
| 926 | |||
| 927 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-adapter.php'; |
||
| 928 | |||
| 929 | /** |
||
| 930 | * Load the WordLift key validation service. |
||
| 931 | */ |
||
| 932 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-key-validation-service.php'; |
||
| 933 | |||
| 934 | // Load the `Wordlift_Category_Taxonomy_Service` class definition. |
||
| 935 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-category-taxonomy-service.php'; |
||
| 936 | |||
| 937 | // Load the `Wordlift_Entity_Page_Service` class definition. |
||
| 938 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-page-service.php'; |
||
| 939 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch-analysis/class-wordlift-batch-analysis-sql-helper.php'; |
||
| 940 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch-analysis/class-wordlift-batch-analysis-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 | |||
| 964 | /** Adapters. */ |
||
| 965 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-tinymce-adapter.php'; |
||
| 966 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-newrelic-adapter.php'; |
||
| 967 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-ajax-adapter.php'; |
||
| 968 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-adapter.php'; |
||
| 969 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch-analysis/class-wordlift-batch-analysis-adapter.php'; |
||
| 970 | |||
| 971 | /** Async Tasks. */ |
||
| 972 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-async-task.php'; |
||
| 973 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-sparql-query-async-task.php'; |
||
| 974 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-batch-analysis-request-async-task.php'; |
||
| 975 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-batch-analysis-complete-async-task.php'; |
||
| 976 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-push-references-async-task.php'; |
||
| 977 | |||
| 978 | /** Async Tasks. */ |
||
| 979 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-service.php'; |
||
| 980 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-adapter.php'; |
||
| 981 | |||
| 982 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-remote-image-service.php'; |
||
| 983 | |||
| 984 | /** |
||
| 985 | * The class responsible for defining all actions that occur in the admin area. |
||
| 986 | */ |
||
| 987 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin.php'; |
||
| 988 | |||
| 989 | /** |
||
| 990 | * The class to customize the entity list admin page. |
||
| 991 | */ |
||
| 992 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-list.php'; |
||
| 993 | |||
| 994 | /** |
||
| 995 | * The Entity Types Taxonomy Walker (transforms checkboxes into radios). |
||
| 996 | */ |
||
| 997 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker.php'; |
||
| 998 | |||
| 999 | /** |
||
| 1000 | * The Notice service. |
||
| 1001 | */ |
||
| 1002 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-notice-service.php'; |
||
| 1003 | |||
| 1004 | /** |
||
| 1005 | * The PrimaShop adapter. |
||
| 1006 | */ |
||
| 1007 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-primashop-adapter.php'; |
||
| 1008 | |||
| 1009 | /** |
||
| 1010 | * The WordLift Dashboard service. |
||
| 1011 | */ |
||
| 1012 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-dashboard.php'; |
||
| 1013 | |||
| 1014 | /** |
||
| 1015 | * The admin 'Install wizard' page. |
||
| 1016 | */ |
||
| 1017 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-setup.php'; |
||
| 1018 | |||
| 1019 | /** |
||
| 1020 | * The WordLift entity type list admin page controller. |
||
| 1021 | */ |
||
| 1022 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-taxonomy-list-page.php'; |
||
| 1023 | |||
| 1024 | /** |
||
| 1025 | * The WordLift entity type settings admin page controller. |
||
| 1026 | */ |
||
| 1027 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-settings.php'; |
||
| 1028 | |||
| 1029 | /** |
||
| 1030 | * The admin 'Download Your Data' page. |
||
| 1031 | */ |
||
| 1032 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-download-your-data-page.php'; |
||
| 1033 | |||
| 1034 | /** |
||
| 1035 | * The admin 'WordLift Settings' page. |
||
| 1036 | */ |
||
| 1037 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/intf-wordlift-admin-element.php'; |
||
| 1038 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-input-element.php'; |
||
| 1039 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-input-radio-element.php'; |
||
| 1040 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-select2-element.php'; |
||
| 1041 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-language-select-element.php'; |
||
| 1042 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-tabs-element.php'; |
||
| 1043 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-author-element.php'; |
||
| 1044 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-publisher-element.php'; |
||
| 1045 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-page.php'; |
||
| 1046 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page.php'; |
||
| 1047 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-batch-analysis-page.php'; |
||
| 1048 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page-action-link.php'; |
||
| 1049 | |||
| 1050 | /** Admin Pages */ |
||
| 1051 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-post-edit-page.php'; |
||
| 1052 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-user-profile-page.php'; |
||
| 1053 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-status-page.php'; |
||
| 1054 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-admin-service.php'; |
||
| 1055 | |||
| 1056 | /** |
||
| 1057 | * The class responsible for defining all actions that occur in the public-facing |
||
| 1058 | * side of the site. |
||
| 1059 | */ |
||
| 1060 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-public.php'; |
||
| 1061 | |||
| 1062 | /** |
||
| 1063 | * The shortcode abstract class. |
||
| 1064 | */ |
||
| 1065 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-shortcode.php'; |
||
| 1066 | |||
| 1067 | /** |
||
| 1068 | * The Timeline shortcode. |
||
| 1069 | */ |
||
| 1070 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-timeline-shortcode.php'; |
||
| 1071 | |||
| 1072 | /** |
||
| 1073 | * The Navigator shortcode. |
||
| 1074 | */ |
||
| 1075 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-navigator-shortcode.php'; |
||
| 1076 | |||
| 1077 | /** |
||
| 1078 | * The chord shortcode. |
||
| 1079 | */ |
||
| 1080 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-chord-shortcode.php'; |
||
| 1081 | |||
| 1082 | /** |
||
| 1083 | * The geomap shortcode. |
||
| 1084 | */ |
||
| 1085 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-geomap-shortcode.php'; |
||
| 1086 | |||
| 1087 | /** |
||
| 1088 | * The entity cloud shortcode. |
||
| 1089 | */ |
||
| 1090 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-shortcode.php'; |
||
| 1091 | |||
| 1092 | /** |
||
| 1093 | * The entity glossary shortcode. |
||
| 1094 | */ |
||
| 1095 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-alphabet-service.php'; |
||
| 1096 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-vocabulary-shortcode.php'; |
||
| 1097 | |||
| 1098 | /** |
||
| 1099 | * The ShareThis service. |
||
| 1100 | */ |
||
| 1101 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-sharethis-service.php'; |
||
| 1102 | |||
| 1103 | /** |
||
| 1104 | * The SEO service. |
||
| 1105 | */ |
||
| 1106 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-seo-service.php'; |
||
| 1107 | |||
| 1108 | /** |
||
| 1109 | * The AMP service. |
||
| 1110 | */ |
||
| 1111 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-amp-service.php'; |
||
| 1112 | |||
| 1113 | /** Widgets */ |
||
| 1114 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-widget.php'; |
||
| 1115 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-widget.php'; |
||
| 1116 | |||
| 1117 | $this->loader = new Wordlift_Loader(); |
||
| 1118 | |||
| 1119 | // Instantiate a global logger. |
||
| 1120 | global $wl_logger; |
||
| 1121 | $wl_logger = Wordlift_Log_Service::get_logger( 'WordLift' ); |
||
| 1122 | |||
| 1123 | // Load the `wl-api` end-point. |
||
| 1124 | new Wordlift_Http_Api(); |
||
| 1125 | |||
| 1126 | // Load the Install Service. |
||
| 1127 | $this->install_service = new Wordlift_Install_Service(); |
||
| 1128 | |||
| 1129 | /** Services. */ |
||
| 1130 | // Create the configuration service. |
||
| 1131 | $this->configuration_service = new Wordlift_Configuration_Service(); |
||
| 1132 | |||
| 1133 | // Create an entity type service instance. It'll be later bound to the init action. |
||
| 1134 | $this->entity_post_type_service = new Wordlift_Entity_Post_Type_Service( Wordlift_Entity_Service::TYPE_NAME, $this->configuration_service->get_entity_base_path() ); |
||
| 1135 | |||
| 1136 | // Create an entity link service instance. It'll be later bound to the post_type_link and pre_get_posts actions. |
||
| 1137 | $this->entity_link_service = new Wordlift_Entity_Link_Service( $this->entity_post_type_service, $this->configuration_service->get_entity_base_path() ); |
||
| 1138 | |||
| 1139 | // Create an instance of the UI service. |
||
| 1140 | $this->ui_service = new Wordlift_UI_Service(); |
||
| 1141 | |||
| 1142 | // Create an instance of the Thumbnail service. Later it'll be hooked to post meta events. |
||
| 1143 | $this->thumbnail_service = new Wordlift_Thumbnail_Service(); |
||
| 1144 | |||
| 1145 | $this->sparql_service = new Wordlift_Sparql_Service(); |
||
| 1146 | $schema_url_property_service = new Wordlift_Schema_Url_Property_Service( $this->sparql_service ); |
||
| 1147 | $this->notice_service = new Wordlift_Notice_Service(); |
||
| 1148 | $this->relation_service = new Wordlift_Relation_Service(); |
||
| 1149 | |||
| 1150 | $entity_uri_cache_service = new Wordlift_File_Cache_Service( WL_TEMP_DIR . 'entity_uri/' ); |
||
| 1151 | $this->file_cache_service = new Wordlift_File_Cache_Service( WL_TEMP_DIR . 'converter/' ); |
||
| 1152 | $this->entity_uri_service = new Wordlift_Cached_Entity_Uri_Service( $this->configuration_service, $entity_uri_cache_service ); |
||
| 1153 | $this->entity_service = new Wordlift_Entity_Service( $this->ui_service, $this->relation_service, $this->entity_uri_service ); |
||
| 1154 | $this->user_service = new Wordlift_User_Service( $this->sparql_service, $this->entity_service ); |
||
| 1155 | |||
| 1156 | // Instantiate the JSON-LD service. |
||
| 1157 | $property_getter = Wordlift_Property_Getter_Factory::create( $this->entity_service ); |
||
| 1158 | |||
| 1159 | /** Linked Data. */ |
||
| 1160 | $this->storage_factory = new Wordlift_Storage_Factory( $this->entity_service, $this->user_service, $property_getter ); |
||
| 1161 | $this->rendition_factory = new Wordlift_Sparql_Tuple_Rendition_Factory( $this->entity_service ); |
||
| 1162 | |||
| 1163 | $this->schema_service = new Wordlift_Schema_Service( $this->storage_factory, $this->rendition_factory, $this->configuration_service ); |
||
| 1164 | |||
| 1165 | // Create a new instance of the Redirect service. |
||
| 1166 | $this->redirect_service = new Wordlift_Redirect_Service( $this->entity_service ); |
||
| 1167 | $this->entity_type_service = new Wordlift_Entity_Type_Service( $this->schema_service ); |
||
| 1168 | $this->linked_data_service = new Wordlift_Linked_Data_Service( $this->entity_service, $this->entity_type_service, $this->schema_service, $this->sparql_service ); |
||
| 1169 | |||
| 1170 | // Create a new instance of the Timeline service and Timeline shortcode. |
||
| 1171 | $this->timeline_service = new Wordlift_Timeline_Service( $this->entity_service, $this->entity_type_service ); |
||
| 1172 | |||
| 1173 | $this->batch_analysis_service = new Wordlift_Batch_Analysis_Service( $this, $this->configuration_service, $this->file_cache_service ); |
||
| 1174 | |||
| 1175 | $this->entity_types_taxonomy_walker = new Wordlift_Entity_Types_Taxonomy_Walker(); |
||
| 1176 | |||
| 1177 | $this->topic_taxonomy_service = new Wordlift_Topic_Taxonomy_Service(); |
||
| 1178 | $this->entity_types_taxonomy_service = new Wordlift_Entity_Type_Taxonomy_Service(); |
||
| 1179 | |||
| 1180 | // Create an instance of the ShareThis service, later we hook it to the_content and the_excerpt filters. |
||
| 1181 | $this->sharethis_service = new Wordlift_ShareThis_Service(); |
||
| 1182 | |||
| 1183 | // Create an instance of the PrimaShop adapter. |
||
| 1184 | $this->primashop_adapter = new Wordlift_PrimaShop_Adapter(); |
||
| 1185 | |||
| 1186 | // Create an import service instance to hook later to WP's import function. |
||
| 1187 | $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() ); |
||
| 1188 | |||
| 1189 | $uri_service = new Wordlift_Uri_Service( $GLOBALS['wpdb'] ); |
||
| 1190 | |||
| 1191 | // Create the entity rating service. |
||
| 1192 | $this->rating_service = new Wordlift_Rating_Service( $this->entity_service, $this->entity_type_service, $this->notice_service ); |
||
| 1193 | |||
| 1194 | // Create entity list customization (wp-admin/edit.php). |
||
| 1195 | $this->entity_list_service = new Wordlift_Entity_List_Service( $this->rating_service ); |
||
| 1196 | |||
| 1197 | // Create a new instance of the Redirect service. |
||
| 1198 | $this->dashboard_service = new Wordlift_Dashboard_Service( $this->rating_service, $this->entity_service ); |
||
| 1199 | |||
| 1200 | // Create an instance of the Publisher Service and the AJAX Adapter. |
||
| 1201 | $this->publisher_service = new Wordlift_Publisher_Service( $this->configuration_service ); |
||
| 1202 | $this->property_factory = new Wordlift_Property_Factory( $schema_url_property_service ); |
||
| 1203 | $this->property_factory->register( Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service ); |
||
| 1204 | |||
| 1205 | $attachment_service = new Wordlift_Attachment_Service(); |
||
| 1206 | |||
| 1207 | // Instantiate the JSON-LD service. |
||
| 1208 | $property_getter = Wordlift_Property_Getter_Factory::create( $this->entity_service ); |
||
| 1209 | $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 ); |
||
| 1210 | $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 ); |
||
| 1211 | $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 ); |
||
| 1212 | $this->jsonld_website_converter = new Wordlift_Website_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service ); |
||
| 1213 | $this->cached_postid_to_jsonld_converter = new Wordlift_Cached_Post_Converter( $this->postid_to_jsonld_converter, $this->file_cache_service, $this->configuration_service ); |
||
| 1214 | $this->jsonld_service = new Wordlift_Jsonld_Service( $this->entity_service, $this->cached_postid_to_jsonld_converter, $this->jsonld_website_converter ); |
||
| 1215 | |||
| 1216 | |||
| 1217 | $this->key_validation_service = new Wordlift_Key_Validation_Service( $this->configuration_service ); |
||
| 1218 | $this->content_filter_service = new Wordlift_Content_Filter_Service( $this->entity_service, $this->configuration_service, $this->entity_uri_service ); |
||
| 1219 | $this->relation_rebuild_service = new Wordlift_Relation_Rebuild_Service( $this->content_filter_service, $this->entity_service ); |
||
| 1220 | $this->sample_data_service = new Wordlift_Sample_Data_Service( $this->entity_type_service, $this->configuration_service, $this->user_service ); |
||
| 1221 | $this->sample_data_ajax_adapter = new Wordlift_Sample_Data_Ajax_Adapter( $this->sample_data_service ); |
||
| 1222 | $this->reference_rebuild_service = new Wordlift_Reference_Rebuild_Service( $this->linked_data_service, $this->entity_service, $this->relation_service ); |
||
| 1223 | |||
| 1224 | // Initialize the shortcodes. |
||
| 1225 | new Wordlift_Navigator_Shortcode(); |
||
| 1226 | new Wordlift_Chord_Shortcode(); |
||
| 1227 | new Wordlift_Geomap_Shortcode(); |
||
| 1228 | new Wordlift_Timeline_Shortcode(); |
||
| 1229 | new Wordlift_Related_Entities_Cloud_Shortcode( $this->relation_service ); |
||
| 1230 | new Wordlift_Vocabulary_Shortcode( $this->configuration_service ); |
||
| 1231 | |||
| 1232 | // Initialize the SEO service. |
||
| 1233 | new Wordlift_Seo_Service(); |
||
| 1234 | |||
| 1235 | // Initialize the AMP service. |
||
| 1236 | new Wordlift_AMP_Service( $this->jsonld_service ); |
||
| 1237 | |||
| 1238 | /** Services. */ |
||
| 1239 | $this->google_analytics_export_service = new Wordlift_Google_Analytics_Export_Service(); |
||
| 1240 | |||
| 1241 | /** Adapters. */ |
||
| 1242 | $this->entity_type_adapter = new Wordlift_Entity_Type_Adapter( $this->entity_type_service ); |
||
| 1243 | $this->publisher_ajax_adapter = new Wordlift_Publisher_Ajax_Adapter( $this->publisher_service ); |
||
| 1244 | $this->tinymce_adapter = new Wordlift_Tinymce_Adapter( $this ); |
||
| 1245 | $this->batch_analysis_adapter = new Wordlift_Batch_Analysis_Adapter( $this->batch_analysis_service ); |
||
| 1246 | $this->relation_rebuild_adapter = new Wordlift_Relation_Rebuild_Adapter( $this->relation_rebuild_service ); |
||
| 1247 | |||
| 1248 | // Create a Rebuild Service instance, which we'll later bound to an ajax call. |
||
| 1249 | $this->rebuild_service = new Wordlift_Rebuild_Service( |
||
| 1250 | $this->sparql_service, |
||
| 1251 | $uri_service |
||
| 1252 | ); |
||
| 1253 | |||
| 1254 | /** Async Tasks. */ |
||
| 1255 | new Wordlift_Sparql_Query_Async_Task(); |
||
| 1256 | new Wordlift_Batch_Analysis_Request_Async_Task(); |
||
| 1257 | new Wordlift_Batch_Analysis_Complete_Async_Task(); |
||
| 1258 | new Wordlift_Batch_Analysis_Complete_Async_Task(); |
||
| 1259 | new Wordlift_Push_References_Async_Task(); |
||
| 1260 | |||
| 1261 | /** WL Autocomplete. */ |
||
| 1262 | $this->autocomplete_service = new Wordlift_Autocomplete_Service( $this->configuration_service ); |
||
| 1263 | $this->autocomplete_adapter = new Wordlift_Autocomplete_Adapter( $this->autocomplete_service ); |
||
| 1264 | |||
| 1265 | /** WordPress Admin UI. */ |
||
| 1266 | |||
| 1267 | // UI elements. |
||
| 1268 | $this->input_element = new Wordlift_Admin_Input_Element(); |
||
| 1269 | $this->radio_input_element = new Wordlift_Admin_Radio_Input_Element(); |
||
| 1270 | $this->select2_element = new Wordlift_Admin_Select2_Element(); |
||
| 1271 | $this->language_select_element = new Wordlift_Admin_Language_Select_Element(); |
||
| 1272 | $tabs_element = new Wordlift_Admin_Tabs_Element(); |
||
| 1273 | $this->publisher_element = new Wordlift_Admin_Publisher_Element( $this->configuration_service, $this->publisher_service, $tabs_element, $this->select2_element ); |
||
| 1274 | $this->author_element = new Wordlift_Admin_Author_Element( $this->publisher_service, $this->select2_element ); |
||
| 1275 | |||
| 1276 | $this->settings_page = new Wordlift_Admin_Settings_Page( $this->configuration_service, $this->entity_service, $this->input_element, $this->language_select_element, $this->publisher_element, $this->radio_input_element ); |
||
| 1277 | $this->batch_analysis_page = new Wordlift_Batch_Analysis_Page( $this->batch_analysis_service ); |
||
| 1278 | $this->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link( $this->settings_page ); |
||
| 1279 | |||
| 1280 | // Pages. |
||
| 1281 | new Wordlift_Admin_Post_Edit_Page( $this ); |
||
| 1282 | new Wordlift_Entity_Type_Admin_Service(); |
||
| 1283 | |||
| 1284 | // create an instance of the entity type list admin page controller. |
||
| 1285 | $this->entity_type_admin_page = new Wordlift_Admin_Entity_Taxonomy_List_Page(); |
||
| 1286 | |||
| 1287 | // create an instance of the entity type etting admin page controller. |
||
| 1288 | $this->entity_type_settings_admin_page = new Wordlift_Admin_Entity_Type_Settings(); |
||
| 1289 | |||
| 1290 | /** Widgets */ |
||
| 1291 | $this->related_entities_cloud_widget = new Wordlift_Related_Entities_Cloud_Widget(); |
||
| 1292 | |||
| 1293 | /* WordPress Admin. */ |
||
| 1294 | $this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page( $this->configuration_service ); |
||
| 1295 | $this->status_page = new Wordlift_Admin_Status_Page( $this->entity_service, $this->sparql_service ); |
||
| 1296 | |||
| 1297 | // Create an instance of the install wizard. |
||
| 1298 | $this->admin_setup = new Wordlift_Admin_Setup( $this->configuration_service, $this->key_validation_service, $this->entity_service ); |
||
| 1299 | |||
| 1300 | $this->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service( $this->entity_post_type_service ); |
||
| 1301 | |||
| 1302 | // User Profile. |
||
| 1303 | new Wordlift_Admin_User_Profile_Page( $this->author_element, $this->user_service ); |
||
| 1304 | |||
| 1305 | $this->entity_page_service = new Wordlift_Entity_Page_Service(); |
||
| 1306 | |||
| 1307 | // Load the debug service if WP is in debug mode. |
||
| 1308 | if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { |
||
| 1309 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-debug-service.php'; |
||
| 1310 | new Wordlift_Debug_Service( $this->entity_service, $uri_service ); |
||
| 1311 | } |
||
| 1312 | |||
| 1313 | // Remote Image Service. |
||
| 1314 | new Wordlift_Remote_Image_Service(); |
||
| 1315 | } |
||
| 1316 | |||
| 1630 |
Instead of super-globals, we recommend to explicitly inject the dependencies of your class. This makes your code less dependent on global state and it becomes generally more testable: