| Conditions | 3 |
| Paths | 2 |
| Total Lines | 503 |
| Code Lines | 204 |
| 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 |
||
| 677 | private function load_dependencies() { |
||
|
|
|||
| 678 | |||
| 679 | /** |
||
| 680 | * The class responsible for orchestrating the actions and filters of the |
||
| 681 | * core plugin. |
||
| 682 | */ |
||
| 683 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-loader.php'; |
||
| 684 | |||
| 685 | /** |
||
| 686 | * The class responsible for defining internationalization functionality |
||
| 687 | * of the plugin. |
||
| 688 | */ |
||
| 689 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-i18n.php'; |
||
| 690 | |||
| 691 | /** |
||
| 692 | * WordLift's supported languages. |
||
| 693 | */ |
||
| 694 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-languages.php'; |
||
| 695 | |||
| 696 | /** |
||
| 697 | * Provide support functions to sanitize data. |
||
| 698 | */ |
||
| 699 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sanitizer.php'; |
||
| 700 | |||
| 701 | /** Services. */ |
||
| 702 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-log-service.php'; |
||
| 703 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-redirect-service.php'; |
||
| 704 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-configuration-service.php'; |
||
| 705 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-type-service.php'; |
||
| 706 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-service.php'; |
||
| 707 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-link-service.php'; |
||
| 708 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-linked-data-service.php'; |
||
| 709 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-relation-service.php'; |
||
| 710 | |||
| 711 | /** |
||
| 712 | * The Query builder. |
||
| 713 | */ |
||
| 714 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-query-builder.php'; |
||
| 715 | |||
| 716 | /** |
||
| 717 | * The Schema service. |
||
| 718 | */ |
||
| 719 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-service.php'; |
||
| 720 | |||
| 721 | /** |
||
| 722 | * The schema:url property service. |
||
| 723 | */ |
||
| 724 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-service.php'; |
||
| 725 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-url-property-service.php'; |
||
| 726 | |||
| 727 | /** |
||
| 728 | * The UI service. |
||
| 729 | */ |
||
| 730 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-ui-service.php'; |
||
| 731 | |||
| 732 | /** |
||
| 733 | * The Thumbnail service. |
||
| 734 | */ |
||
| 735 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-thumbnail-service.php'; |
||
| 736 | |||
| 737 | /** |
||
| 738 | * The Entity Types Taxonomy service. |
||
| 739 | */ |
||
| 740 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-types-taxonomy-service.php'; |
||
| 741 | |||
| 742 | /** |
||
| 743 | * The Entity service. |
||
| 744 | */ |
||
| 745 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-service.php'; |
||
| 746 | |||
| 747 | // Add the entity rating service. |
||
| 748 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rating-service.php'; |
||
| 749 | |||
| 750 | /** |
||
| 751 | * The User service. |
||
| 752 | */ |
||
| 753 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-user-service.php'; |
||
| 754 | |||
| 755 | /** |
||
| 756 | * The Timeline service. |
||
| 757 | */ |
||
| 758 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-timeline-service.php'; |
||
| 759 | |||
| 760 | /** |
||
| 761 | * The Topic Taxonomy service. |
||
| 762 | */ |
||
| 763 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-topic-taxonomy-service.php'; |
||
| 764 | |||
| 765 | /** |
||
| 766 | * The SPARQL service. |
||
| 767 | */ |
||
| 768 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sparql-service.php'; |
||
| 769 | |||
| 770 | /** |
||
| 771 | * The WordLift import service. |
||
| 772 | */ |
||
| 773 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-import-service.php'; |
||
| 774 | |||
| 775 | /** |
||
| 776 | * The WordLift URI service. |
||
| 777 | */ |
||
| 778 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-uri-service.php'; |
||
| 779 | |||
| 780 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-listable.php'; |
||
| 781 | |||
| 782 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-factory.php'; |
||
| 783 | |||
| 784 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-service.php'; |
||
| 785 | |||
| 786 | /** |
||
| 787 | * The WordLift rebuild service, used to rebuild the remote dataset using the local data. |
||
| 788 | */ |
||
| 789 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rebuild-service.php'; |
||
| 790 | |||
| 791 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/properties/class-wordlift-property-getter-factory.php'; |
||
| 792 | |||
| 793 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-attachment-service.php'; |
||
| 794 | |||
| 795 | /** |
||
| 796 | * Load the converters. |
||
| 797 | */ |
||
| 798 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/intf-wordlift-post-converter.php'; |
||
| 799 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-abstract-post-to-jsonld-converter.php'; |
||
| 800 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-postid-to-jsonld-converter.php'; |
||
| 801 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-to-jsonld-converter.php'; |
||
| 802 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-to-jsonld-converter.php'; |
||
| 803 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-website-converter.php'; |
||
| 804 | |||
| 805 | /** |
||
| 806 | * Load the content filter. |
||
| 807 | */ |
||
| 808 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-content-filter-service.php'; |
||
| 809 | |||
| 810 | /* |
||
| 811 | * Load the excerpt helper. |
||
| 812 | */ |
||
| 813 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-excerpt-helper.php'; |
||
| 814 | |||
| 815 | /** |
||
| 816 | * Load the JSON-LD service to publish entities using JSON-LD.s |
||
| 817 | * |
||
| 818 | * @since 3.8.0 |
||
| 819 | */ |
||
| 820 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-service.php'; |
||
| 821 | |||
| 822 | // The Publisher Service and the AJAX adapter. |
||
| 823 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-service.php'; |
||
| 824 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-ajax-adapter.php'; |
||
| 825 | |||
| 826 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-adapter.php'; |
||
| 827 | |||
| 828 | /** |
||
| 829 | * Load the WordLift key validation service. |
||
| 830 | */ |
||
| 831 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-key-validation-service.php'; |
||
| 832 | |||
| 833 | // Load the `Wordlift_Category_Taxonomy_Service` class definition. |
||
| 834 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-category-taxonomy-service.php'; |
||
| 835 | |||
| 836 | // Load the `Wordlift_Entity_Page_Service` class definition. |
||
| 837 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-page-service.php'; |
||
| 838 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-batch-analysis-service.php'; |
||
| 839 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-relation-rebuild-service.php'; |
||
| 840 | |||
| 841 | /** Linked Data. */ |
||
| 842 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage.php'; |
||
| 843 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-storage.php'; |
||
| 844 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-property-storage.php'; |
||
| 845 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-taxonomy-storage.php'; |
||
| 846 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-schema-class-storage.php'; |
||
| 847 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-author-storage.php'; |
||
| 848 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-uri-storage.php'; |
||
| 849 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-image-storage.php'; |
||
| 850 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-related-storage.php'; |
||
| 851 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-url-property-storage.php'; |
||
| 852 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage-factory.php'; |
||
| 853 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-sparql-tuple-rendition.php'; |
||
| 854 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-sparql-tuple-rendition-factory.php'; |
||
| 855 | |||
| 856 | /** Adapters. */ |
||
| 857 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-tinymce-adapter.php'; |
||
| 858 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-newrelic-adapter.php'; |
||
| 859 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-ajax-adapter.php'; |
||
| 860 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-adapter.php'; |
||
| 861 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-batch-analysis-adapter.php'; |
||
| 862 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-relation-rebuild-adapter.php'; |
||
| 863 | |||
| 864 | /** Async Tasks. */ |
||
| 865 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/wp-async-task.php'; |
||
| 866 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-sparql-query-async-task.php'; |
||
| 867 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-batch-analysis-request-async-task.php'; |
||
| 868 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-batch-analysis-complete-async-task.php'; |
||
| 869 | |||
| 870 | /** Async Tasks. */ |
||
| 871 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-service.php'; |
||
| 872 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-adapter.php'; |
||
| 873 | |||
| 874 | /** |
||
| 875 | * The class responsible for defining all actions that occur in the admin area. |
||
| 876 | */ |
||
| 877 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin.php'; |
||
| 878 | |||
| 879 | /** |
||
| 880 | * The class to customize the entity list admin page. |
||
| 881 | */ |
||
| 882 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-list.php'; |
||
| 883 | |||
| 884 | /** |
||
| 885 | * The Entity Types Taxonomy Walker (transforms checkboxes into radios). |
||
| 886 | */ |
||
| 887 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker.php'; |
||
| 888 | |||
| 889 | /** |
||
| 890 | * The Notice service. |
||
| 891 | */ |
||
| 892 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-notice-service.php'; |
||
| 893 | |||
| 894 | /** |
||
| 895 | * The PrimaShop adapter. |
||
| 896 | */ |
||
| 897 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-primashop-adapter.php'; |
||
| 898 | |||
| 899 | /** |
||
| 900 | * The WordLift Dashboard service. |
||
| 901 | */ |
||
| 902 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-dashboard.php'; |
||
| 903 | |||
| 904 | /** |
||
| 905 | * The admin 'Install wizard' page. |
||
| 906 | */ |
||
| 907 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-setup.php'; |
||
| 908 | |||
| 909 | /** |
||
| 910 | * The WordLift entity type list admin page controller. |
||
| 911 | */ |
||
| 912 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-taxonomy-list-page.php'; |
||
| 913 | |||
| 914 | /** |
||
| 915 | * The WordLift entity type settings admin page controller. |
||
| 916 | */ |
||
| 917 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-settings.php'; |
||
| 918 | |||
| 919 | /** |
||
| 920 | * The admin 'Download Your Data' page. |
||
| 921 | */ |
||
| 922 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-download-your-data-page.php'; |
||
| 923 | |||
| 924 | /** |
||
| 925 | * The admin 'Download Your Data' page. |
||
| 926 | */ |
||
| 927 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-download-your-data-page.php'; |
||
| 928 | |||
| 929 | /** |
||
| 930 | * The admin 'WordLift Settings' page. |
||
| 931 | */ |
||
| 932 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/intf-wordlift-admin-element.php'; |
||
| 933 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-input-element.php'; |
||
| 934 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-input-radio-element.php'; |
||
| 935 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-select2-element.php'; |
||
| 936 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-language-select-element.php'; |
||
| 937 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-tabs-element.php'; |
||
| 938 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-author-element.php'; |
||
| 939 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-publisher-element.php'; |
||
| 940 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-page.php'; |
||
| 941 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page.php'; |
||
| 942 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-batch-analysis-page.php'; |
||
| 943 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page-action-link.php'; |
||
| 944 | |||
| 945 | /** Admin Pages */ |
||
| 946 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-post-edit-page.php'; |
||
| 947 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-user-profile-page.php'; |
||
| 948 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-status-page.php'; |
||
| 949 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-admin-service.php'; |
||
| 950 | |||
| 951 | /** |
||
| 952 | * The class responsible for defining all actions that occur in the public-facing |
||
| 953 | * side of the site. |
||
| 954 | */ |
||
| 955 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-public.php'; |
||
| 956 | |||
| 957 | /** |
||
| 958 | * The shortcode abstract class. |
||
| 959 | */ |
||
| 960 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-shortcode.php'; |
||
| 961 | |||
| 962 | /** |
||
| 963 | * The Timeline shortcode. |
||
| 964 | */ |
||
| 965 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-timeline-shortcode.php'; |
||
| 966 | |||
| 967 | /** |
||
| 968 | * The Navigator shortcode. |
||
| 969 | */ |
||
| 970 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-navigator-shortcode.php'; |
||
| 971 | |||
| 972 | /** |
||
| 973 | * The chord shortcode. |
||
| 974 | */ |
||
| 975 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-chord-shortcode.php'; |
||
| 976 | |||
| 977 | /** |
||
| 978 | * The geomap shortcode. |
||
| 979 | */ |
||
| 980 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-geomap-shortcode.php'; |
||
| 981 | |||
| 982 | /** |
||
| 983 | * The entity cloud shortcode. |
||
| 984 | */ |
||
| 985 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-shortcode.php'; |
||
| 986 | |||
| 987 | /** |
||
| 988 | * The ShareThis service. |
||
| 989 | */ |
||
| 990 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-sharethis-service.php'; |
||
| 991 | |||
| 992 | /** |
||
| 993 | * The SEO service. |
||
| 994 | */ |
||
| 995 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-seo-service.php'; |
||
| 996 | |||
| 997 | /** |
||
| 998 | * The AMP service. |
||
| 999 | */ |
||
| 1000 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-amp-service.php'; |
||
| 1001 | |||
| 1002 | /** Widgets */ |
||
| 1003 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-widget.php'; |
||
| 1004 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-widget.php'; |
||
| 1005 | |||
| 1006 | $this->loader = new Wordlift_Loader(); |
||
| 1007 | |||
| 1008 | // Instantiate a global logger. |
||
| 1009 | global $wl_logger; |
||
| 1010 | $wl_logger = Wordlift_Log_Service::get_logger( 'WordLift' ); |
||
| 1011 | |||
| 1012 | /** Services. */ |
||
| 1013 | // Create the configuration service. |
||
| 1014 | $this->configuration_service = new Wordlift_Configuration_Service(); |
||
| 1015 | |||
| 1016 | // Create an entity type service instance. It'll be later bound to the init action. |
||
| 1017 | $this->entity_post_type_service = new Wordlift_Entity_Post_Type_Service( Wordlift_Entity_Service::TYPE_NAME, $this->configuration_service->get_entity_base_path() ); |
||
| 1018 | |||
| 1019 | // Create an entity link service instance. It'll be later bound to the post_type_link and pre_get_posts actions. |
||
| 1020 | $this->entity_link_service = new Wordlift_Entity_Link_Service( $this->entity_post_type_service, $this->configuration_service->get_entity_base_path() ); |
||
| 1021 | |||
| 1022 | // Create an instance of the UI service. |
||
| 1023 | $this->ui_service = new Wordlift_UI_Service(); |
||
| 1024 | |||
| 1025 | // Create an instance of the Thumbnail service. Later it'll be hooked to post meta events. |
||
| 1026 | $this->thumbnail_service = new Wordlift_Thumbnail_Service(); |
||
| 1027 | |||
| 1028 | $this->sparql_service = new Wordlift_Sparql_Service(); |
||
| 1029 | $schema_url_property_service = new Wordlift_Schema_Url_Property_Service( $this->sparql_service ); |
||
| 1030 | $this->notice_service = new Wordlift_Notice_Service(); |
||
| 1031 | $this->relation_service = new Wordlift_Relation_Service(); |
||
| 1032 | $this->entity_service = new Wordlift_Entity_Service( $this->ui_service, $this->relation_service ); |
||
| 1033 | $this->user_service = new Wordlift_User_Service(); |
||
| 1034 | |||
| 1035 | // Instantiate the JSON-LD service. |
||
| 1036 | $property_getter = Wordlift_Property_Getter_Factory::create( $this->entity_service ); |
||
| 1037 | |||
| 1038 | /** Linked Data. */ |
||
| 1039 | $this->storage_factory = new Wordlift_Storage_Factory( $this->entity_service, $this->user_service, $property_getter ); |
||
| 1040 | $this->rendition_factory = new Wordlift_Sparql_Tuple_Rendition_Factory( $this->entity_service ); |
||
| 1041 | |||
| 1042 | $this->schema_service = new Wordlift_Schema_Service( $this->storage_factory, $this->rendition_factory, $this->configuration_service ); |
||
| 1043 | |||
| 1044 | // Create a new instance of the Redirect service. |
||
| 1045 | $this->redirect_service = new Wordlift_Redirect_Service( $this->entity_service ); |
||
| 1046 | $this->entity_type_service = new Wordlift_Entity_Type_Service( $this->schema_service ); |
||
| 1047 | $this->linked_data_service = new Wordlift_Linked_Data_Service( $this->entity_service, $this->entity_type_service, $this->schema_service, $this->sparql_service ); |
||
| 1048 | |||
| 1049 | // Create a new instance of the Timeline service and Timeline shortcode. |
||
| 1050 | $this->timeline_service = new Wordlift_Timeline_Service( $this->entity_service, $this->entity_type_service ); |
||
| 1051 | |||
| 1052 | $this->batch_analysis_service = new Wordlift_Batch_Analysis_Service( $this, $this->configuration_service ); |
||
| 1053 | |||
| 1054 | $this->entity_types_taxonomy_walker = new Wordlift_Entity_Types_Taxonomy_Walker(); |
||
| 1055 | |||
| 1056 | $this->topic_taxonomy_service = new Wordlift_Topic_Taxonomy_Service(); |
||
| 1057 | |||
| 1058 | // Create an instance of the ShareThis service, later we hook it to the_content and the_excerpt filters. |
||
| 1059 | $this->sharethis_service = new Wordlift_ShareThis_Service(); |
||
| 1060 | |||
| 1061 | // Create an instance of the PrimaShop adapter. |
||
| 1062 | $this->primashop_adapter = new Wordlift_PrimaShop_Adapter(); |
||
| 1063 | |||
| 1064 | // Create an import service instance to hook later to WP's import function. |
||
| 1065 | $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() ); |
||
| 1066 | |||
| 1067 | $uri_service = new Wordlift_Uri_Service( $GLOBALS['wpdb'] ); |
||
| 1068 | |||
| 1069 | // Create a Rebuild Service instance, which we'll later bound to an ajax call. |
||
| 1070 | $this->rebuild_service = new Wordlift_Rebuild_Service( $this->sparql_service, $uri_service ); |
||
| 1071 | |||
| 1072 | // Create the entity rating service. |
||
| 1073 | $this->rating_service = new Wordlift_Rating_Service( $this->entity_service, $this->entity_type_service, $this->notice_service ); |
||
| 1074 | |||
| 1075 | // Create entity list customization (wp-admin/edit.php) |
||
| 1076 | $this->entity_list_service = new Wordlift_Entity_List_Service( $this->rating_service ); |
||
| 1077 | |||
| 1078 | // Create a new instance of the Redirect service. |
||
| 1079 | $this->dashboard_service = new Wordlift_Dashboard_Service( $this->rating_service, $this->entity_service ); |
||
| 1080 | |||
| 1081 | // Create an instance of the Publisher Service and the AJAX Adapter. |
||
| 1082 | $publisher_service = new Wordlift_Publisher_Service(); |
||
| 1083 | $this->property_factory = new Wordlift_Property_Factory( $schema_url_property_service ); |
||
| 1084 | $this->property_factory->register( Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service ); |
||
| 1085 | |||
| 1086 | $attachment_service = new Wordlift_Attachment_Service(); |
||
| 1087 | |||
| 1088 | // Instantiate the JSON-LD service. |
||
| 1089 | $property_getter = Wordlift_Property_Getter_Factory::create( $this->entity_service ); |
||
| 1090 | $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 ); |
||
| 1091 | $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, $this->entity_post_to_jsonld_converter ); |
||
| 1092 | $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 ); |
||
| 1093 | $this->jsonld_website_converter = new Wordlift_Website_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service, $this->entity_post_to_jsonld_converter ); |
||
| 1094 | $this->jsonld_service = new Wordlift_Jsonld_Service( $this->entity_service, $this->postid_to_jsonld_converter, $this->jsonld_website_converter ); |
||
| 1095 | |||
| 1096 | $this->key_validation_service = new Wordlift_Key_Validation_Service( $this->configuration_service ); |
||
| 1097 | $this->content_filter_service = new Wordlift_Content_Filter_Service( $this->entity_service, $this->configuration_service ); |
||
| 1098 | $this->relation_rebuild_service = new Wordlift_Relation_Rebuild_Service( $this->content_filter_service, $this->entity_service ); |
||
| 1099 | $this->sample_data_service = new Wordlift_Sample_Data_Service( $this->entity_type_service, $this->configuration_service ); |
||
| 1100 | $this->sample_data_ajax_adapter = new Wordlift_Sample_Data_Ajax_Adapter( $this->sample_data_service ); |
||
| 1101 | |||
| 1102 | // Initialize the shortcodes. |
||
| 1103 | new Wordlift_Navigator_Shortcode(); |
||
| 1104 | new Wordlift_Chord_Shortcode(); |
||
| 1105 | new Wordlift_Geomap_Shortcode(); |
||
| 1106 | new Wordlift_Timeline_Shortcode(); |
||
| 1107 | new Wordlift_Related_Entities_Cloud_Shortcode( $this->relation_service ); |
||
| 1108 | |||
| 1109 | // Initialize the SEO service. |
||
| 1110 | new Wordlift_Seo_Service(); |
||
| 1111 | |||
| 1112 | // Initialize the AMP service. |
||
| 1113 | new Wordlift_AMP_Service(); |
||
| 1114 | |||
| 1115 | /** Adapters. */ |
||
| 1116 | $this->entity_type_adapter = new Wordlift_Entity_Type_Adapter( $this->entity_type_service ); |
||
| 1117 | $this->publisher_ajax_adapter = new Wordlift_Publisher_Ajax_Adapter( $publisher_service ); |
||
| 1118 | $this->tinymce_adapter = new Wordlift_Tinymce_Adapter( $this ); |
||
| 1119 | $this->batch_analysis_adapter = new Wordlift_Batch_Analysis_Adapter( $this->batch_analysis_service ); |
||
| 1120 | $this->relation_rebuild_adapter = new Wordlift_Relation_Rebuild_Adapter( $this->relation_rebuild_service ); |
||
| 1121 | |||
| 1122 | /** Async Tasks. */ |
||
| 1123 | new Wordlift_Sparql_Query_Async_Task(); |
||
| 1124 | new Wordlift_Batch_Analysis_Request_Async_Task(); |
||
| 1125 | new Wordlift_Batch_Analysis_Complete_Async_Task(); |
||
| 1126 | |||
| 1127 | /** WL Autocomplete. */ |
||
| 1128 | $this->autocomplete_service = new Wordlift_Autocomplete_Service( $this->configuration_service ); |
||
| 1129 | $this->autocomplete_adapter = new Wordlift_Autocomplete_Adapter( $this->autocomplete_service ); |
||
| 1130 | |||
| 1131 | /** WordPress Admin UI. */ |
||
| 1132 | |||
| 1133 | // UI elements. |
||
| 1134 | $this->input_element = new Wordlift_Admin_Input_Element(); |
||
| 1135 | $this->radio_input_element = new Wordlift_Admin_Radio_Input_Element(); |
||
| 1136 | $this->select2_element = new Wordlift_Admin_Select2_Element(); |
||
| 1137 | $this->language_select_element = new Wordlift_Admin_Language_Select_Element(); |
||
| 1138 | $tabs_element = new Wordlift_Admin_Tabs_Element(); |
||
| 1139 | $this->publisher_element = new Wordlift_Admin_Publisher_Element( $this->configuration_service, $publisher_service, $tabs_element, $this->select2_element ); |
||
| 1140 | $this->author_element = new Wordlift_Admin_Author_Element( $publisher_service, $this->select2_element ); |
||
| 1141 | |||
| 1142 | $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 ); |
||
| 1143 | $this->batch_analysis_page = new Wordlift_Batch_Analysis_Page( $this->batch_analysis_service ); |
||
| 1144 | $this->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link( $this->settings_page ); |
||
| 1145 | |||
| 1146 | // Pages. |
||
| 1147 | new Wordlift_Admin_Post_Edit_Page( $this ); |
||
| 1148 | new Wordlift_Entity_Type_Admin_Service(); |
||
| 1149 | |||
| 1150 | // create an instance of the entity type list admin page controller. |
||
| 1151 | $this->entity_type_admin_page = new Wordlift_Admin_Entity_Taxonomy_List_Page(); |
||
| 1152 | |||
| 1153 | // create an instance of the entity type etting admin page controller. |
||
| 1154 | $this->entity_type_settings_admin_page = new Wordlift_Admin_Entity_Type_Settings(); |
||
| 1155 | |||
| 1156 | /** Widgets */ |
||
| 1157 | $this->related_entities_cloud_widget = new Wordlift_Related_Entities_Cloud_Widget(); |
||
| 1158 | |||
| 1159 | //** WordPress Admin */ |
||
| 1160 | $this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page( $this->configuration_service ); |
||
| 1161 | $this->status_page = new Wordlift_Admin_Status_Page( $this->entity_service, $this->sparql_service ); |
||
| 1162 | |||
| 1163 | // Create an instance of the install wizard. |
||
| 1164 | $this->admin_setup = new Wordlift_Admin_Setup( $this->configuration_service, $this->key_validation_service, $this->entity_service ); |
||
| 1165 | |||
| 1166 | $this->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service( $this->entity_post_type_service ); |
||
| 1167 | |||
| 1168 | // User Profile. |
||
| 1169 | new Wordlift_Admin_User_Profile_Page( $this->author_element, $this->user_service ); |
||
| 1170 | |||
| 1171 | $this->entity_page_service = new Wordlift_Entity_Page_Service(); |
||
| 1172 | |||
| 1173 | // Load the debug service if WP is in debug mode. |
||
| 1174 | if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { |
||
| 1175 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-debug-service.php'; |
||
| 1176 | new Wordlift_Debug_Service( $this->entity_service, $uri_service ); |
||
| 1177 | } |
||
| 1178 | |||
| 1179 | } |
||
| 1180 | |||
| 1445 |
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: